Macro-embedding Compiler Intermediate Languages in Racket
summary
Implements a macro-embedding that derives a family of compiler intermediate languages inside Racket to generate 120 interpreters for a compilers course, mixing safe functional abstractions and unsafe assembly features (registers, labels, jumps, pointer arithmetic). Uses identifier macros and a variable-like transformer abstraction so set! interoperates with module-scoped mutable boxes, expands labels to letrec-bound procedures with captured exit continuations, and exposes interpreters via modules and contracts; core embedding lives in base.rkt (≈600 lines) and the approach succeeds for most features.
AI-written summary · about
chapters (5)
- 0:00Start
- 5:01Just using macros... (won't be enough)
- 9:24Macros that work together
- 14:52Non-syntactic interposition points
- 17:56Module system
related talks
17mMacros for Domain-Specific Languages
01h 03mModern Macros
40mLet's Build a Hygienic Macro Expander
34mHackett: a metaprogrammable Haskell
38mDemystifying compilers by writing your own
19mRhombus: A New Spin on Macros without All the Parentheses
20mPredictable macros for hindley milner
45mLanguage-Oriented Programming with Racket
