Com S 342 meeting -*- Outline -*- needed: the textbook! tell them to read the forward and the preface * Teaser ** 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 ------------------------------------------ successful technique for implementing complex languages, saving space, etc. Used countless times since to write first versions of new languages, special-purpose languages, and to study programming languages. a special-purpose language is the ultimate abstraction of a domain ** 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 ------------------------------------------ ... faster development cycle programs smaller than compiled code easier than compiler to write and change the last one is the important one. But the techniques we teach, are the essence of writing compilers too. * The course itself ** 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: ----------------------------------------- ... capable of expressing all computations For example, Scheme and C++ are programming languages. Q: Others? Java, Ada, PL/I, BASIC, COBOL, Pascal, SNOBOL, Icon, MUMPS, Algol W, Algol 60, Algol 68, C, Haskall, Edison, ... (literally thousands) But the techniques we'll study aren't just limited to general-purpose programming langauges. These don't have to be able to compute all computable functions. examples: Lotus 1-2-3 macros, the MFC class library, SQL. Q: Others? Formal languages are also used in a variety of settings: music, knitting, mathematics, ... ** history tell how this course came about (briefly) how I come to it ** objectives In one sentence, the main objective is that you will have a deep, working knowledge of the functional paradigm and the key ideas used in modern programming languages. ------------------------------------------ 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. ------------------------------------------ these are the essential ideas in PLs. Q: what is functional style? use functions as arguments etc. to help modularize your code Why? - help you think about good ways to program, abstraction mechanisms - (see below for functional style) - data abstraction is key to making programs easily modifiable - learn new languages quickly mapping ideas from this class to the language - read/write language reference manual - help you program more effectively - most programs evolve into languages, or have language parts ------------------------------------------ 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 ------------------------------------------ Q: How is a programming language like a religion? seems to get the same kind of devotion from its followers We're asking you to experience a new religion! ** skills ------------------------------------------ SKILLS WE TEACH IN 342 + functional abstraction techniques + data abstraction + how to build interpreters + meta-linguistic abstraction ------------------------------------------ explain that meta-linguistic abstraction is building a new language to help you solve your problems, OOP is like that. Can consider doing this in Scheme to be supporting objectives because of the book, mostly but Scheme is well suited to task Why? - polymorphic (no type limitations) - matches semantic formalism (lambda calculus) pure theory of functions, core of PLs - programs similar to data - part of the material for a course like this is to learn ways to program ** syllabus *** when note how the above connects with the meetings the class, and chapters of the book we'll try to go fast up to chapter 5, then take however much time needed *** prerequisites We intend to enforce the formal prerequisites as best we can, if you don't have these, drop this course. ------------------------------------------ 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 ------------------------------------------ You'll have to make up for lack of Scheme quickly if don't have it Q: will you raise your hand if you don't know Scheme? Schedule a Scheme "jam session", first week. *** what work is involved think of this as like a math course, frequent problems to do, we go fast ------------------------------------------ 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 ------------------------------------------ time needed depends on your background *** texts show it ------------------------------------------ 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) ------------------------------------------ Also there is stuff on reserve *** grading ------------------------------------------ GRADING + No curve grading + Your grade is 70% based on tests 30% on homework ------------------------------------------ moral: use homeworks to learn, cheating on homework won't help details in course-policies handout, on-line in $PUB/docs/policies-complete.txt *** ask for questions/concerns discuss them