Constructing Customized Interpreters from Reusable Evaluators using GAME

Printer-friendly version

Publication Type:

Conference Paper

Source:

Proceedings of the 11th International Conference on Software Composition (SC12) (2012)

Abstract:

<p>Separationofconcernsisdifficulttoachieveintheimplemen- tation of a programming language interpreter. We argue that evaluator concerns (i.e., those implementing the operational semantics of the lan- guage) 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 cus- tomized interpreters from a reusable evaluator and different variants of its supporting runtime. To this end, Game offers a language for spec- ifying the evaluator according to the generic programming methodol- ogy. Through a transformation into defunctionalized monadic style, the Game toolchain generates a generic abstract machine in which the se- quencing 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.</p>