| Subject | Materials | When | |
|---|---|---|---|
| 1 | Standard ML as a meta language, the Moscow ML system, abstract syntax, a simple expression language, direct interpretation of expressions, environments. |
Lecture 1 slides
Exercise sheet 1 sem1.sml Moscow ML Read Chapter 1 and Appendix A: Standard ML crash course from Programming Language Concepts. | Wed 2 Feb (PS; lecture only, no exercises) |
| 2 | Interpreters and compilers, static checking of programs, postfix (reverse Polish) notation, a stack (abstract) machine, Postscript, correctness of compilation relative to interpretation |
Lecture 2 slides
Exercise sheet 2 sem2.sml sierpinski.eps expr/Machine.java Read Chapter 2 of Programming Language Concepts. | Wed 9 Feb (PS+PS) |
| 3 | Concrete syntax, regular expressions, context free grammars, scanning and parsing: from linear text to abstract syntax tree, using mosmllex and mosmlyac, a scanner and parser for the expression language, a scanner and a parser for micro-SQL, a sublanguage of SQL; SML: simple Moscow ML modules and compilation units. |
Lecture 3 slides
Exercise sheet 3 expr.zip usql.zip Read Sections 2.1-2.5, 2.9, 3.1-3.6, and 3.16 of Torben Mogensen's Basics of Compiler Design. Read Chapter 3 of Programming Language Concepts. | Wed 16 Feb (PS+AW) |
| 4 | Interpretation of a first-order functional language: arithmetic and logical expressions, non-assignable variables, if-then-else expressions, function calls (without explicit evaluation stack), and recursive closures. Explicit monomorphic types, type checking. |
Lecture 4 slides
Exercise sheet 4 fun1.zip Nested.java Nested.cs Read Chapter 4 of Programming Language Concepts. | Wed 23 Feb (PS+AW) |
| 5 | A higher-order functional language. An implicitly typed language. Parametric polymorphic types. Type inference. Parametric polymorphism in Java 5.0 and C# 2.0. |
Lecture 5 slides
Exercise sheet 5 sem5.sml fun2.zip Read Chapter 5 of Programming Language Concepts. | Wed 2 Mar (PS+AW) |
| 6 | Modelling an imperative language: assignable variables, arithmetic and logical expressions, variable declarations, assignment, loops, output; lvalues and rvalues; environment and store; parameter passing mechanisms; C pointers and arrays. |
Lecture 6 slides
Exercise sheet 6 imp1.zip Read Sections 5.1-5.5 of Kernighan and Ritchie. Read Chapter 6 of Programming Language Concepts. Read Christopher Strachey: Fundamental Concepts in Programming Languages. | Wed 9 Mar (AW+AW) |
| 7 | An abstract machine with program counter, explicit evaluation stack, and instructions for arithmetics, jumps, conditional jumps, function call, return etc. Compilation of the imperative language micro-C to a sequence of abstract machine instructions, whose store is a collection of numbered storage cells. |
Lecture 7 slides
Exercise sheet 7 imp2.zip Read Chapter 7 of Programming Language Concepts. | Wed 16 Mar (AW+AW) |
| 8 | A continuation-based interpreter for a functional language, exception-free modelling of exceptions; continuation-based interpreter for an imperative language, modelling micro-Icon, a language with backtracking. |
Lecture 8 slides
Exercise sheet 8 cont.zip Read Chapter 8 of Programming Language Concepts, and C. Queinnec: Continuations and web servers. Higher-Order and Symbolic Computation, 17(4):279-297, November 2004. | Wed 30 Mar (PS+AW) |
| 9 | Guest lecture: Beta, an object-oriented language very different from Java. | Wed 6 Apr (Kasper Østerbye) | |
| 10 | Backwards (continuation-based) code generation, one-pass compilation of boolean expressions into control flow code, avoid jumps to jumps, compile tail calls to execute in constant space. |
Lecture 9 slides
Exercise sheet 9 imp3.zip Read Chapter 9 of Programming Language Concepts. | Wed 13 Apr (PS+AW) |
| 11 | Java Virtual Machine (JVM) as a realistic abstract machine. Compiling micro-C to JVM bytecode. A comparison of JVM and CLR (Microsoft's Common Language Runtime) as used in Microsoft .NET. Garbage collection, stack, and heap. Javascript, a class-less object-oriented language. |
Lecture 10 slides Updated Tuesday 23:50
Exercise sheet 10 imp4.zip Peter Bertelsen's SML-JVM Toolkit for Linux and for Windows and a brief description of it. Sun's JVM specification, Microsoft .NET Framework download. The Mono Implementation of CLR Overview of CLR by Meijer and Gough. Read Chapters 10 and 11 of Programming Language Concepts. | Wed 20 Apr (PS+AW) |
| 12 | Reflection and runtime code generation in Java/JVM and C#/CLR. |
Lecture 11 slides
rtcg.zip Read Chapters 13 and 14 of Programming Language Concepts. | Wed 27 Apr (PS+AW) |