SPLASH 2021 (series) / GPCE 2021 (series) / GPCE 2021 - 20th International Conference on Generative Programming: Concepts & Experiences / Multi-Stage Programming with Generative and Analytical Macros
Multi-Stage Programming with Generative and Analytical MacrosVirtualGPCE Best Paper Award
Mon 18 Oct 2021 09:30 - 09:45 at Zurich C - SLE/GPCE Session 5 Chair(s): Eelco Visser
Mon 18 Oct 2021 17:30 - 17:45 at Zurich C - SLE/GPCE Session 5 Chair(s): Paddy Krishnan
Mon 18 Oct 2021 17:30 - 17:45 at Zurich C - SLE/GPCE Session 5 Chair(s): Paddy Krishnan
In metaprogramming, code generation and code analysis are complementary. Traditionally, principled metaprogramming extensions for programming languages, like MetaML and BER MetaOCaml, offer strong foundations for code generation but lack equivalent support for code analysis. Similarly, existing macro systems are biased towards the code generation aspect.
In this work, we present a calculus for macros featuring both code generation and code analysis. The calculus directly models separate compilation of macros, internalizing a commonly neglected aspect of macros. The system ensures that the generated code is well-typed and hygienic.
We implement our system in Scala 3, provide a formalization, and prove its soundness.
Mon 18 OctDisplayed time zone: Central Time (US & Canada) change
Mon 18 Oct
Displayed time zone: Central Time (US & Canada) change