Eternal Sunshine of the Spotless Macro
summary
Survey of reflective models and code-generation techniques, with concrete demos: Smalltalk live reflection creates classes and rebinds object classes at runtime; Groovy AST transforms inject logging by modifying the AST; Scala 3 macros rewrite fluent assertions into plain asserts and implement a staged power function that compiles an integer exponent into O(log n) multiplications with hygienic renamed temps; and Java’s Project Babylon exposes a code model for procedural transformations. All examples compile and run; debugging expanded code relies on printed or compiler messages.
AI-written summary · about
chapters (8)
- 0:00Meta programming intro
- 2:57Reflection systems
- 8:58Meta object protocols
- 13:22Generative programming
- 17:17Macros and compile-time
- 24:48Runtime macros and multi-stage
- 33:28Java’s meta limits
- 39:16Q&A








