WG211/M23Ballantyne
A language workbench as library (Michael Ballantyne)
Systems such as Racket and Spoofax allow programmers to develop DSLs with custom syntax, static semantics, compilation, and IDE support. Unfortunately, these technologies mostly have not reached mainstream programmers. I argue that to reach mainstream use, such a language-oriented programming system must satisfy several conditions: (1) be incrementally adoptable in an existing, widely-used language (2) enable its users to gradually acquire the skill of creating DSLs, and (3) provide excellent IDE support for DSLs.
To prototype an architecture for such a system, I have developed the syntax-spec
"language workbench as a library" on top of Racket's macro system. syntax-spec
supports both whole-DSL specification, providing support for the DSL's backend compiler, as well as Racket's conventional lightweight hygienic macros on top of the DSL. The ideas behind syntax-spec
should be portable to other languages with macro systems, such as Rust and Scala, but this will require some additional work to reconcile with the syntax and type systems of these languages.
Slides: ballantyne-slides.pdf