Dynamix: a DSL for semantics definition via CPS transformation
Speaker: Andrew Tolmach
Abstract
Continuation-passing style (CPS) is a restricted form of lambda calculus in which all function applications are in tail position; instead of returning, a function passes its result to a continuation parameter. Its uniform treatment of all kinds of control flow make CPS useful as a compiler intermediate representation. In this work, we show how the semantics of a source language can be conveniently expressed by specifying how to transform that language into CPS. Since the CPS transformation algorithm is notoriously hard to read, we propose Dynamix, a DSL for writing such transformations. Dynamix exists in several incarnations, including a prototype integrated into the Spoofax Language Designer/s Workbench, and a stand-alone embedded DSL in Haskell. We argue that, with appropriate surface syntax, Dynamix specifications are almost as easy to read as definitional interpreters, while allowing more straightforward and efficiently compilable treatment of non-standard control flow. This is joint work with the late Eelco Visser, Casper Bach Poulsen, Thijs Molendijk, and Ruben van Baarle at TU Delft.