Compiler Construction
Lecture slides
- Lecture 1 (2023-01-20)
- Lecture 2 (2023-01-23): Lexing
- Lecture 3 (2023-01-25): Context-free grammars
- Lecture 4 (2023-01-27): LL parsing
- Lecture 5 (2023-01-30): Foundations of LR parsing
- Lecture 6 (2023-02-01): SLR(1) and LR(1) (updated 2023-02-20)
- Lecture 7 (2023-02-03): Translation
- Lecture 8 (2023-02-06): CPS & defunctionalization
- Lecture 9 (2023-02-08): Deriving interpreter 2
- Lecture 10 (2023-02-10): Interpreter 3
- Lecture 11 (2023-02-13): The Jargon VM
- Lecture 12 (2023-02-15): Garbage collection
- Lecture 13 (2023-02-17): Optimisation
- Lecture 14 (2023-02-20): Exceptions
- Lecture 15 (2023-02-22): Linking
- Lecture 16 (2023-02-24): Bootstrapping
Additional material
- Lecture 1 (introduction)
- Compiler explorer: examine the output of compilers for C, Java, OCaml, Python, Rust, ...
- Lecture 2 (lexing)
- Glushkov's construction algorithm (Wikipedia)
- OCaml implementation of Glushkov's construction algorithm
- Regular expression derivatives reexamined (Owens, Reppy & Turon, 2009)
- 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)
- Lecture 14 (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)
(Last year’s course materials are also still available.)