Compiler Construction
Lecture slides
- Lecture 1 (2025-01-24): introduction
- Lecture 2 (2025-01-27): lexing
- Lecture 3 (2025-01-29): context-free grammars (updated 2025-01-30)
- Lecture 4 (2025-01-31): LL parsing
- Lecture 5 (2025-02-03): Foundations of LR parsing
- Lecture 6 (2025-02-05): SLR(1) and LR(1) (updated 2025-02-07)
- Lecture 7 (2025-02-07): translation
- Lecture 8 (2025-02-10): CPS & defunctionalization
- Lecture 9 (2025-02-12): Deriving interpreter 2 (updated 2025-03-05)
- Lecture 10 (2025-02-14): Interpreter 3
- Lecture 11 (2025-02-17): The Jargon VM
- Lecture 12 (2025-02-19): Garbage collection
- Lecture 13 (2025-02-21): Exceptions
- Lecture 14 (2025-02-24): Optimisation
- Lecture 15 (2025-02-26): Linking
- Lecture 16 (2025-02-28): Bootstrapping
Additional material
- Lecture 1 (introduction)
- Compiler explorer: examine the output of compilers for C, Java, OCaml, Python, Rust, ...
- Lecture 2 (lexing)
- Lecture 4 (LL parsing)
- LL(1) parser visualization
- JFLAP can also generate LL(1) parse tables
- Lectures 7-11 (The slang compiler)
- Slang implementation
- Online slang explorer
- Defunctionalization: everybody does it, nobody talks about it (SIGPLAN blog)
- Suggestions for Slang improvements (from Prof Timothy Griffin)
- Rocq proof that
fib m k = k (fib m)
- Lecture 13 (Exception handling)
- Lecture 15 (Linking)
- Linkers and Loaders (John Levine)
- Advanced Programming in the UNIX Environment (W. Richard Stevens and Stephen A. Rago)
- Lecture 16 (Bootstrapping)
- Chapter 13 (Bootstrapping a compiler) of Basics of Compiler Design (Torben Ægidius Mogensen)
- A formalism for translator interactions (Jay Earley and Howard Sturgis, 1970)
- Reflections on Trusting Trust (Ken Thompson's 1984 Turing Award lecture about a "Trojan horse" bug related to bootstrapping)
- Debootstrapping without Archeology: Stacked Implementations in Camlboot (N. Courant, J. Lepiller, G. Scherer, 2022)