I particated in the Language Workbench Challenge recently, which is held every year as part of the Code Generation conference in Cambridge. In this challenge, participants are asked to implement a case study in a variety of Language Workbenches (tools for developing Domain Specific Languages), with the goal to compare and contrast the different tools.

Because I value simplicity (and, admittedly, because I like being a little contrary), I participated this year with the express goal of not doing my solution in something that is typically considered a Language Workbench. Instead, I tried solving the problem in Clojure. Being a Lisp, it is part of the family of languages that is canonically intended for metaprogramming, due to it having macros (code that expands into more code at compile-time).

I felt that using a General Purpose Language (GPL) with good metaprogramming support is preferable to a heavyweight external tool such as a language workbench, and I wanted to prove you can get results just as quickly and easily.

Some other tools also take this approach, such as Dclare and Xtend, but during the rest of the LWC and CodeGen I’ve also gained an appreciation for other fine metaprogramming tools that are out there. Especially MPS, which I think has a great vision of the future of programming and which I intended to look into further.

Anyway, here is my submission:

Video:

(Many thanks to Risto Pohjonen for recording this).