Development EnvironmentDrRacket: 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 Lecture Notes and Supporting FilesJan 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 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. ReadingsFeb 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 Feb 28: Macros via Read/do sections 1-9 of the Quick introduction to Racket. A reference for tracing, which uses slightly visual notation: SICP. TutorialsFeb 03: Generating rearrangements/permutations of a list. Feb 10: Review: Binary Trees. Optional or Optional-for-now ReadingsLambda CalculusGenerality: Booleans, Arithmetic, Fibonacci from only lazy lambdas. Implementing Recursion without mutation. MiscA 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. |