Work

First Class Syntax, Semantics, and Their Composition

Year: 2013
Type: conference-paper
Abstract: Ideally complexity is managed by composing a system out of quite a few, more or less independent, and much smaller descriptions of various aspects of the overall artefact. When describing (extensible) programming languages, attribute grammars have turned out to be an excellent tool for modular definition and integration of their different aspects. In this paper we show how to construct a programming language implementation by composing a collection of separately compiled attribute grammar fragments, each describing a separate aspect of the language. More specifically we describe how to use a coherent set of libraries and tools which together makes it possible to express this directly in Haskell, where the correctness of the composition is enforced through the Haskell type system's ability to represent attribute grammars as plain Haskell values and their interfaces as Haskell types makes this possible. Semantic objects thus constructed can be combined with parsers which are constructed on the fly out of a collection of grammar fragments, which are also represented by typed Haskell values. Again the type checker prevents unsound compositions. Using a very small example language and some simple extensions, we show how our techniques fit together towards the construction of extensible compilers out of a collection of pre-compiled, statically type-checked "language definition fragments".
Language: English
Subfield: Software
Open Access status: green
OpenAlex ID: W1975052385
FWCI: 0.96
Cites: 72
Cited by: 8
Related to: 10