This page gives highlights of past lectures and provides lecture notes, reading assignments, and exercises.
Chapters, sections and exercises in readings are from the textbook, unless specified otherwise.
Readings on F# link directly to online resources, such as examples or the Wikibook on F# Programming.
Dates  Topics  Exercises 

Aug 21 Aug 23 
Course introduction and administration.
Overview of course topics.
Programming language paradigms.
Brief history of programming languages.
Compilation vs. interpretation.
Issues and factors in programming language design.


Aug 30 
Variable binding. Variable scope ands scoping rules.
Function definitions.
Pattern matching.
Patterns in let expressions and in function definitions.


Aug 29 
The match construct. Meaning and common uses.
Scoping of pattern variables in match.
Use of match in function definitions.


Sep 4 Sep 6 
Using ADTs to encode arithmetic expressions.
Simple evaluators of arithmetic expressions.


Sep 11 Sep 13 
Discussion of Hw1 solutions.

All ex. in code 5 
Sep 18 Sep 20 
Compiling expressions with variable names to expressions with variable indices.
Stack machines for expression evaluation, with variables and without.
Compiling expressions to stack machine code.
Running stack machine code.
Examples.
Producing byte code.

All ex. in code 6 
Sep 25 
No class. 

Sep 27 
Formal languages.
Regular expressions. Languages generated by regular expressions.
Finite Automata.
Finite automata as recognizers of regular languages.
Examples.
Applications to programming languages.

Practice problems in today's readings 
Oct 2 
Nondeterministic finitestate automata (NFAs).
Definition and examples.
Relationships between NFAs, deterministic automata and regular expressions.
Contextfree grammars and languages.
Definition and examples.
Lecture notes by Wayne Goddard on 
Practice problems in today's readings 
Oct 4 
More on contextfree grammars and languages.
Systematically generating CFG's from regular expressions.
Derivations and derivation trees.
Ambiguous grammars.
Examples and exercises.
Pushdown automata.
Recognizing contextfree languages with pushdown automata.
Examples.
Lecture notes on

Practice problems in today's readings 
Oct 9 
Midterm I 

Oct 11 
More on derivations and derivation trees.
From concrete to abstract syntax.
Lexers, parsers and generators.
Specifying lexers and parsers in F# with fslex and fsyacc.
A concrete syntax and a lexer and parser for a simple language of expressions.


Oct 16 Oct 18 
More on automatically generated parsers.
Example of pushdown automaton parser generated
by fsyacc.
Brief discussion of Midterm I solutions and grades.
Examples of microML programs.
Interpreting microML.
Specifying interpreters formally with evaluation rules.
Implementation of specification in F#, via eval function.
Static and dynamic scope.


Oct 23 
Static vs. dynamic typing.
Adding typechecking to microML.
Formal typechecking rules.
Implementation of type checker.


Oct 25 
Higherorder functions in F#.
Currying and partial evaluation.
Higherorder combinators.
Examples.


Oct 30 
Extending MicroML to higherorder functions. Comparison between interpreters for firstorder and higherorder microML. Examples of higherorder programming in MicroML.
Records in F#.
Mutable and immutable fields.
Mutable variables.
While loops.


Nov 1 
Additional F# features. Alternative syntax for parametric types. Immutable maps. Option types and their uses. Sequencing of expressions with the ; operator.
Imperative programming. Main concepts.
Programs as state transformers.
A naive imperative language.
Environment and store.


Nov 6 Nov 8 
The C programming language.
Integers, pointers and arrays in C.
Type declarations in C.
The microC language.
Interpreting microC programs.
Local and global environments.
Memory model. Store and activation records.
Interpreting statements, declarations, expressions, and variable access
in the presence of side effects.
Relationship between & (address) and * (pointer dereferencing) operators.


Nov 13 Nov 15 
An virtual stack machine for microC.
Instruction set, concrete and symbolic.
Virtual machine as implemented in Java.
The structure of the runtime stack.
Compiling microC to machine code: overview
of main approach.

Exercises in lecture notes 
Nov 20 Nov 22 
Thanksgiving break 

Nov 27 
Midterm II 

Nov 29 
More on microC compilation.
Examples of compilation.
Compilation to real machine code.
Realworld virtual machines.
An overview of the Java virtual machine.
Brief comparison with CLI (.NET) virtual machine.
Byte code verification.
Justintime compilation.


Dec 4 
Review of stack and heap allocation.
Garbage collection.
The free list.
Garbage collection techniques.
Reference counting. Marksweep collection.
Twospace stopandcopy collection.
Generational GC.
Conservative GC.
Garbage collectors in various languages.


Dec 6 
Project Q&A session. 
