Compiler Construction
Lecture slides
- Lecture 1 (2024-01-19): introduction
- Lecture 2 (2024-01-22): lexing (updated 2024-01-24)
- Lecture 3 (2024-01-24): context-free grammars (updated 2024-01-26)
- Lecture 4 (2024-01-26): LL parsing (updated 2024-04-29: in slide "FOLLOW" the production for T was updated)
- Lecture 5 (2024-01-29): Foundations of LR parsing
- Lecture 6 (2024-01-31): SLR(1) and LR(1) (updated 2024-02-08: in slide "Constructing ACTION and GOTO for LR(1)" the lookahead in the shift case is b, not a)
- Lecture 7 (2024-02-02): translation
- Lecture 8 (2024-02-05): CPS & defunctionalization
- Lecture 9 (2024-02-07): Deriving interpreter 2
- Lecture 10 (2024-02-09): Interpreter 3
- Lecture 11 (2024-02-12): The Jargon VM
- Lecture 12 (2024-02-14): garbage collection
- Lecture 13 (2024-02-16): exceptions
- Lecture 14 (2024-02-19): optimisation
- Lecture 15 (2024-02-21): linking
- Lecture 16 (2024-02-23): 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)
- A backtracking lexer example
- 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 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)
(Last year’s course materials are also still available.)