Writing a Nanopass Compiler
summary
Nanopass framework builds a compiler as many tiny, checked passes rather than monolithic phases, with formal grammars that auto-generate traversal boilerplate and immediate well-formedness errors. The project claims to have replaced Chez Scheme compiler (student prototype scaled to a commercial compiler) and expands a backend to 52 back-end passes while keeping reasonable speed (self-hosting compile ~10s vs original ~3s). The example implements a subset of Scheme targeting C, uses 61-bit tagged integers and a flat closure representation, and the code is on GitHub.
AI-written summary · about
chapters (9)
- 0:00Start
- 0:39Compiler History
- 3:27Nanopass History
- 6:59Nanopass Framework
- 9:52Aside: Chez Scheme
- 11:56Example
- 26:56What about closures?
- 28:00What about C?
- 35:35What else can we do?
related talks
23mTyped, Concise, Nanopass (pick 3) (Extended Abstract)
40mType-safe Nanopasses: How to write a safe and modern compiler front-end
29mNanopass Attribute Grammars
34mEfficient Nanopass Compilers using Cats and Matryoshka
01h 07mKeynote – Andy Keep
25mNano-parsing: A Data-parallel Architecture for Perverse Parsing Environments
53mLocknote: How Badly Do We Want Correct Compilers?
15mCopy-and-Patch Compilation
