Separation of concerns is difficult to achieve in the implementation of a programming language interpreter. We argue that evaluator concerns (i.e., those implementing the operational semantics of the language) are, in particular, difficult to separate from the runtime concerns (e.g., memory and stack management) that support them. This precludes the former from being reused and limits variability in the latter. In this paper, we present the Game environment for composing customized interpreters from a reusable evaluator and different variants of its supporting runtime. To this end, Game offers a language for specifying the evaluator according to the generic programming methodology. Through a transformation into defunctionalized monadic style, the Game toolchain generates a generic abstract machine in which the sequencing of low-level interpretational steps is parameterized. Given a suitable instantiation of these parameters for a particular runtime, the toolchain is able to inject the runtime into the generic abstract machine such that a complete interpreter is generated.
To validate our approach, we port the prototypical Scheme evaluator to Game and compose the resulting generic abstract machine with several runtimes that vary in their automatic memory management as well as their stack discipline.
Original languageEnglish
Title of host publicationProceedings of the 11th International Conference on Software Composition (SC2012)
Pages97-113
Number of pages17
Volume7306
Publication statusPublished - 2012
Event11th International Conference on Software Composition - Prague, Czech Republic
Duration: 31 May 20121 Jun 2012

Publication series

NameLecture notes in Computer Science

Conference

Conference11th International Conference on Software Composition
Abbreviated titleSC 2012
CountryCzech Republic
CityPrague
Period31/05/121/06/12

    Research areas

  • generic programming, code generation, language interpreters, monads

ID: 2155878