I. Preliminaries to the first meeting ------------------------------------------ WELCOME TO Com S 342 PRINCIPLES OF PROGRAMMING LANGUAGES Professor Gary T. Leavens 229 Atanasoff Hall phone: 294-1580 email: leavens@cs.iastate.edu Office Hours: URL: http://www.cs.iastate.edu/ ~leavens/ComS342.html 1. Pick up handouts (5 of them) ------------------------------------------ II. staff introductions III. Teaser A. how this comes to be ------------------------------------------ LANGUAGES 6000 years ago - civilizations started - taxation made need for records - first writing ~50 years ago - first computers - programming nearly impossible 1957 (April) - first programming language, FORTRAN 1960 - paper on universality of LISP leads to realization that one can write an interpreter for LISP in LISP ------------------------------------------ B. so what is an interpreter? ------------------------------------------ COMPILERS vs. INTERPRETERS (Scheme program) -----------> output interpreter {C++ program} | | compiler | v [exectuable] ----------> output machine ADVANTAGES OF COMPILERS/INTERPRETERS compilers interpreters code runs ~10 times faster ------------------------------------------ IV. The course itself A. What is a programming language? ------------------------------------------ PROGRAMMING LANGUAGE def: a *programming language* is a language that is def: a *general-purpose langauge* is one that is not tailored to some particular application area. Examples: def: an *special-purpose language* is a language that is designed to support some particular application. Examples: ----------------------------------------- Others? Others? B. history C. objectives ------------------------------------------ Com S 342 ESSENTIAL OBJECTIVES You should be able to: 1. Write and modify programs in functional style 2. Make effective use of data abstraction 3. Change or enhance interpreters to have features such as: - control flow, - variables, - recursion, - scoping, - syntactic sugars, - arrays - parameter passing mechanisms, - objects, and inheritance 4. Write programs using such features and explain their behavior 5. Explain the data structures and algorithms used in interpreters. 6. Compare alternatives in design and implementation. ------------------------------------------ what is functional style? ------------------------------------------ REASONS FOR USING FUNCTIONAL STYLE - Makes certain programs clearer - can see all inputs eval(exp, env) - functions as arguments helps in: abstraction modularization - gives you more ways to solve problems - ideas important for: - algorithm design - specification - describing programming languages - it's interesting and fun ------------------------------------------ How is a programming language like a religion? D. skills ------------------------------------------ SKILLS WE TEACH IN 342 + functional abstraction techniques + data abstraction + how to build interpreters + meta-linguistic abstraction ------------------------------------------ E. syllabus 1. when 2. prerequisites ------------------------------------------ PREREQUISITES Com S 331 (a co-requisite) + context-free grammars + halting problem + 330: logic and set theory Com S 321 + data representation in computers Com S 361 or Com S 309 + writing medium-sized programs + design, modularization, documentation + imperative programming techniques + 228: ADTs, classes, message passing + 228: fundamental data structures ------------------------------------------ will you raise your hand if you don't know Scheme? 3. what work is involved ------------------------------------------ ESTIMATED TIME NEEDED FOR HOMEWORK Average: about 12 hrs/week. Mode: about than 13.5 hrs/week. Range: 0-5 to more than 14 hrs/week. ADVICE ON TIME + try not to work the second 1/2 semester + if you work 20 hrs, only take 12 credits + don't take more than 16 credits with 342 ------------------------------------------ 4. texts ------------------------------------------ TEXTBOOKS Required: Essentials of Programming Languages Recommended: Revised^5 Report on ... Scheme (Course packet at Copyworks, but you can also read this on the web) ------------------------------------------ 5. grading ------------------------------------------ GRADING + No curve grading + Your grade is 70% based on tests 30% on homework ------------------------------------------ 6. ask for questions/concerns V. discussion of course policies ------------------------------------------ FOR YOU TO DO In groups of 3 (or 4) for 5 minutes: a. introduce yourselves b. write down at least 1 question about the policies, course specification, or syllabus that you agree is confusing or you want to talk about c. select someone to ask the question(s) ------------------------------------------ VI. wrapping up the first class A. explain where the course documents are B. last minute reminders C. write most important point, what you'd like to hear more about