pmatos / racket-news

Repository for the Racket News Website
https://racket-news.com
11 stars 2 forks source link

Macros for Domain-Specific Languages #15

Closed spdegabrielle closed 3 years ago

spdegabrielle commented 3 years ago

https://2020.splashcon.org/details/splash-2020-oopsla/105/Macros-for-Domain-Specific-Languages https://dl.acm.org/doi/pdf/10.1145/3428297 Macros for Domain-Specific Languages MICHAEL BALLANTYNE, PLT @ Northeastern University, USA ALEXIS KING, Northwestern University, USA MATTHIAS FELLEISEN, PLT @ Northeastern University, USA Macros provide a powerful means of extending languages. They have proven useful in both general-purpose and domain-specific programming contexts. This paper presents an architecture for implementing macro- extensible DSLs on top of macro-extensible host languages. The macro expanders of these DSLs inherit the syntax system, hygienic expansion, and more from the host. They transform the extensible DSL syntax into a DSL core language. This arrangement has several important consequences. It becomes straightforward to integrate the syntax of various DSLs and the host language when their expanders share these inherited components. Also, a DSL compiler may be designed around a fixed core language, even for an extensible DSL. Finally, macros empower programmers to safely grow DSLs on their own and tailor them to their needs.