Creating Domain-Specific Languages by Composing Syntactical Constructs
Abstract
Creating a programming language is a considerable undertaking, even for relatively small domain-specific languages (DSLs). Most approaches to ease this task either limit the flexibility of the DSL or consider entire languages as the unit of composition. This paper presents a new approach using syntactical constructs (also called syncons) for defining DSLs in much smaller units of composition while retaining flexibility. A syntactical construct defines a single language feature, such as an if statement or an anonymous function. Each syntactical construct is fully self-contained: it specifies its own concrete syntax, binding semantics, and runtime semantics, independently of the rest of the language. The runtime semantics are specified as a translation to a user defined target language, while the binding semantics allow name resolution before expansion. Additionally, we present a novel approach for dealing with syntactical ambiguity that arises when combining languages, even if the languages are individually unambiguous. The work is implemented and evaluated in a case study, where small subsets of OCaml and Lua have been defined and composed using syntactical constructs.
BibTeX
@inproceedings{palmkvist2019creating,
author = {Viktor Palmkvist and David Broman},
title = {{Creating Domain-Specific Languages by Composing Syntactical Constructs}},
booktitle = {PADL},
year = {2019},
doi = {10.1007/978-3-030-05998-9\_12},
}Ask Althea to put this paper to the test.
Loading related content...