Multi-Stage Programming with Generative and Analytical Macros
summary
Defines a formal lambda-triangle calculus that models generative and analytical macros, quote patterns, and separate compilation; implements it in Scala 3 implementation and proves preservation and progress so generated code is hygienic and well typed. The system internalizes compilation-stage persistence allowing macros to match compiled definitions, describes unlifting and bind-patterns that capture subexpressions as quoted lambdas, and shows macro expansion executes before moving staged terms to level 0.
AI-written summary · about
chapters (6)
- 0:00Introduction to macro system
- 1:04Quotes, splices, and macros
- 2:50Lambda triangle calculus
- 4:52Typing and evaluation rules
- 6:28Quote pattern matching
- 9:19Compilation and conclusion
related talks
42mAvoiding macros with inline and derived
39mPhilosophy of Scala macros
43mAdventures in Metaprogramming: Macros versus Shapeless
27mDo You Even Macro?
36mDependently Typed Multi-Stage Programming, Revisited
48mMetaprogramming in Dotty
44mMetaprogramming 2.0
32mMacoCaml: Staging Composable and Compilable Macros
