CSC324 — Content

Development Environment

DrRacket: on CDF, and free to download for Linux, Mac and Windows.

A keybindings file with support file and sample dynamic lookup file. Put them in your home directory and add K.rkt via the Edit/Keybindings menu. Try Ctrl-2 to change font size, 2^ followed by Ctrl-| to get a superscript 2, and < followed by Ctrl-| to get a dynamic lookup producing «». Then read the comments in K.rkt.

Lecture Notes and Supporting Files

Jan 11: The main syntactic and semantic model.

Jan 16: More examples good for thinking about syntax and tracing semantics.

A program to draw the syntax model given explicitly tagged code. Updated to represent empty lists as trees.

Jan 18: more semantic tracing, with a tracer library using a model/drawing library. Examples to trace with comments on using the library.

Jan 19 [virtual lecture]: even more tracing examples, with an updated tracer library. If you want motivation, read the comments about the '!-loop' example!

Jan 21 [support for Jan 23]: extended tracer [see Jan 23 lecture note for comment about the extensions]. The tracer and its model/drawing library.

Jan 23: Structs via Closures.

Jan 30: Structured Data: Pattern Matching. In Racket for now, but will come up in Haskell and generalize [which we'll also see and/or implement in Racket] in Prolog.

Feb 01: Higher Order Functions: Mapping and Applying, Filtering [after recursing some HTML].

Feb 13: User-Defined Syntactic Forms: Curried define and overriding the call form for some infix.

Feb 15: Used-Defined Syntactic Forms inspired by solutions and commentary for A1 Q1.

Feb 27: Variable Mutation.

Feb 29: Loops.

Mar 05: Structs and Pre-OO.

Mar 07: Classes from Structs.

Mar 12: Control Flow. Part I: Composition and Sequencing.

Mar 14: Control Flow. Backtracking I.

Mar 19: Control Flow. Break and Continue.

Mar 26: Introduction to Haskell Syntax and Laziness. Uses the syntax diagrammer as a library.

Mar 27: Lazy Evaluation. Implementation: for top students interested in how lazy evaluation works inside, and a good source of tracing for everyone to practice. The tracer has been extended with a couple of the common forms we us, and to layout lambda bodies better.

Apr 02: Algebraic Types.

Readings

Feb 29: The Guide 16.1.4 "Matching Sequences" has an example of a macro expanding to use of another macro, and two "..."s in a pattern "mapped" in parallel in the template.

Feb 28: Review set! and expand a macro ["named let"].

Feb 28: Macros via syntax-rules: read and understand the first paragraph of the Guide Chapter 16 "Macros". Then sections 16.1.1/2 discuss the swap Lecture example, skippable if the Lecture notes suffice. Then remind yourself of multiple clauses in full syntax-rules: 16.1.3.

Read/do sections 1-9 of the Quick introduction to Racket.

A reference for tracing, which uses slightly visual notation: SICP.

Tutorials

Feb 03: Generating rearrangements/permutations of a list.

Feb 10: Review: Binary Trees.

Optional or Optional-for-now Readings

Lambda Calculus

Generality: Booleans, Arithmetic, Fibonacci from only lazy lambdas.

Implementing Recursion without mutation.

Misc

A student asked me about making our own syntactic forms that make new names. That's quite advanced, although by the end of the course I hope we can discuss the issues involved [mainly "lexical scope", which is a fundamental concept for all programming langauges]. Here to keep that student, and perhaps a few others, busy is a pedagogical example that I've made about as accessible as reasonable without fully teaching everything inbetween.