CSCE 330 (Spring 2005): Lecture Log

January 11 (Tue), 2004 Questionnaire, with discussion; syllabus, reasons for studying Concepts of PLs. (Ghezzi and Jazayeri, parts of Ch.1)

January 13 (Thu), 2005 Programming languages as a component of the software development process. Programming methodologies: waterfall, RUDE, spiral. Influence of program development process on PL design. Example: Separation of concerns, information hiding, divide and conquer, abstraction, OOP.

January 18 (Tue), 2005 Quiz 1. Influence of hardware on PL design: the von Neumann architecture: destructive assignment and loss of referential transparency, sequential execution, iteration as the preferred means of repetition (over recursion). The functional and logic families: main features. More on architecture, e.g.: Lambda machines and the Symbolics; Mago's machine;

January 20 (Thu), 2005 Quiz 2. HW1 assigned, due Thursday, January 27: Exercises 2,3, and 4 on p.32 of [G&J]. The definition-based factorial program in a functional language (ML), a logic language (Prolog), and an imperative pseudo-language (Pascal-like), with a discussion of the differences. Pure compilation. Interpretation, hybrid translation, intermediate code, with examples.

January 25 (Tue), 2005 No quiz. Ariane short paper by Bertand Meyer handed out. FGCS project and the PIM. Genealogy of PLs. LISP example: factorial.

January 27 (Thu), 2005 Q3. Syntax and semantics: introduction. Diagramming sentences. Lexical analysis versus parsing. Chomsky hierarchy. BNF (introduction).

February 1 (Tue), 2005 Q4. HW1 returned. HW2 assigned, due February 8. BNF, with examples. Derivation, parse (syntax) trees, ambiguous grammars.

February 3 (Thu), 2005 Quiz 5. HW3 assigned, due February 10: exercises 1, 2, and 11 on p.107 of textbook. Notes on denotational semantics, with while loop example, handed out. More on BNF, EBNF, Syntax diagrams, with examples from ML and Pascal. Type and scope rules (static semantics), attribute grammars, with an example, to be completed by showing actual decorated parse trees.

February 8 (Tue), 2005 Q6. (Note: this is almost identical to Q5, so no solution guide is provided.) HW2 collected. HW3 is due on the coming Thursday. Attribute grammars, completed. Binding and binding times. Variables. Semantic distinction between declaration, command, and expression. Denotational semantics: basics.

February 10 (Thu), 2005 Q7. HW3 was not collected today, because in question 11, "variables" should be replaced by "functions." Students should return HW3, as amended, on Tuesday. Midterm 1 will be on Tuesday, February 15. Denotational semantics, completed, with example.

February 15 (Tue), 2005 MT1. HW3 collected.

February 17 (Thu), 2005 MT1 returned and discussed. Axiomatic semantics, with an example of the technique of loop invariants.

February 22 (Tue), 2005 Q8. HW2 returned. Proving recursive and iterative programs correct, respectively by direct induction and by the technique of loop invariants: factorial. Introduction to operational semantics. (Projector/laptop combination did not work today.)

February 25 (Thu), 2005 No Quiz. Operational semantics: Simplesem, its execution cycle, architecture, instruction set (basic). C1, with the Euclid algorithm example translated into Simplesem.

March 1 (Tue), 2005 Q9. HW3 returned. PR1 assigned (C1, Euclid's algorithm), due March 15 (Tuesday after spring break). Static languages: C1, C2, C2'; Fortran.

March 3 (Thu), 2005 Q10. Stack-based languages: introduction, direct (or simple, or linear) recursion and indirect recursion with examples (combinations, take and skip), the language C3. Computer projector does not work.

March 15 (Tue), 2005 John Backus's tape on FP. Class led by Alexander Alexandrov, teaching assistant for the course.

March 17 (Thu), 2005 Q11. PR1 due on Friday at midnight, using the departmental dropbox, if not already turned in. Stack-based languages (C3), completed. Block structure: C4' and C4''.

March 22 (Tue), 2005 Review of static links. C5: semi-dynamic languages: dynamic arrays (as in Algol 68 and Ada). Dynamic variables (pointers). The heap. Dangling pointers. Garbage. Coalescing and compacting. Garbage collection. The mark-sweep algorithm. Supporting method invocation by transforming it into function calling with the receiver object as an additional argument.

March 24 (Thu), 2005 Parameter passing: by value, value-result, reference, name. Operational semantics of the first three methods. Differences between value-result and reference. FP: introduction, some primitive functions, some functional forms.

March 29 (Tue), 2005 Q12. PR2 assigned: FP functions, due Tuesday, April 5. More FP: review of primitive functions, conclusion on functional forms, examples (eq0, sub1, fact, brief discussion of some vector and matrix operations). Introduction to ML, just started with pointers to the run-time support on the Unix machines and the available downloads for SML-NJ and MOSML.

March 31 (Thu), 2005 Q13. ML, using SML-NJ on the laptop: chapter 2 up to type constructors (tuples and lists: just begun). Midterm will be one week from today.

April 5 (Tue), 2005 HW4: 2.1.2, 2.2.2, 2.4.1, 2.4.3 through 2.4.6, due Tuesday, April 12. MT2 will be on Thursday. ML: ch.2 finished, ch. 3 started: simple functions.

April 7 (Thu), 2005 MT2

April 12 (Tue), 2005 PR3 and PR4 assigned, both due on Tuesday, April 19: PR3: 2.1.1, 3.1.1, 3.1.2, 3.2.1. PR4: 3.3.1, 3.3.2, 3.3.3, 3.3.7, 3.3.11 More on ML functions: directly and indirectly recursive functions, with examples, functions on lists, with examples, patterns, lazy vs. eager (strict) evaluation, with an example (if vs. cond).

April 14 (Thu), 2005 Q14. Handouts on student presentations, which will be on the last day of classes. Students are to email proposals for three languages to be presented as a four-student team. More on ML functions: tail-recursive vs. non-tail-recursive functions, with an example (fact vs. facti), fast exponentiation, block structure (let...in...end) with the powerset example, fast reverse (with accumulator or difference list).

April 19 (Tue), 2005 Q15, with rather long discussion of the answers. PR3 and PR4 collected. Take-home final requirements handed out and discussed. Students are encouraged to ask questions about the ML part of the take-home exam on the last day of classes. ML: simulating imperative code (the spaghetti code example), functions that return tuples (minmax), functions that take other functions as arguments (ins), insertion sort, merge.

April 21 (Thu), 2005 SimpleMap and Curried map in ML. Prolog, with family relations and knight's moves example.