Modern Macros
summary
Racket treats macros as an open front end to the compiler: the expander handles three concrete cases—macro call, macro definition (define-syntax), and core forms—and produces a well‑known IR; scope is tracked by syntax objects with scope sets so fresh names avoid capture automatically. The system uses define-syntax / syntax-parse and a module system that records compile‑time-of‑compile‑time dependencies (the DrRacket build even runs a ray tracer at compile time). This enables languages like Scribble, Redex, Typed Racket and IDE features such as IDE rename/refactoring to work reliably.
AI-written summary · about
chapters (15)
- 0:00Welcome and introduction
- 3:23Modern macros as a compiler
- 8:06Language examples in Racket
- 10:56Technical aspects of expansion
- 14:44Macro definitions and usage
- 17:31Communication between macros
- 21:25Data structure: Syntax objects
- 25:44Scope management and hygiene
- 30:57Scope implementation details
- 37:06Pattern matching in macros
- 42:41Evaluation of macro code
- 44:17Dependency and module system
- 48:10Educational language design
- 52:24Typed Racket and Redex
- 54:10Future work and Q&A
related talks
17mMacros for Domain-Specific Languages
40mLet's Build a Hygienic Macro Expander
23mMacro-embedding Compiler Intermediate Languages in Racket
19mRhombus: A New Spin on Macros without All the Parentheses
25mRewriting Macros on the Fly: A Modular Approach to Administrative Reduction During(…)
39mPhilosophy of Scala macros
27mDo You Even Macro?
42mThe Macronomicon
