Modular Interpreters for the Masses: Implicit Context Propagation using Object Algebras
Presented at the ACM International Conference on Generative Programming and Component Engineering, Pittsburgh, PA, USA
Modular interpreters have the potential to achieve component-based language development: instead of writing language interpreters from scratch, they can be assembled from reusable, semantic building blocks. Unfortunately, traditional language interpreters are hard to extend because different language constructs may require different interpreter signatures. For instance, arithmetic interpreters produce a value without any context information, whereas binding constructs require an additional environment. In this paper, we present a practical solution to this problem based on implicit context propagation. By structuring denotational-style interpreters as Object Algebras, base interpreters can be retroactively lifted into new interpreters that have an extended signature. The additional parameters are implicitly propagated behind the scenes, through the evaluation of the base interpreter. Interpreter lifting enables a flexible style of component-based language development. The technique works in mainstream object-oriented languages, does not sacrifice type safety or separate compilation, and can be easily automated. We illustrate implicit context propagation using a modular definition of Featherweight Java and its extension to support side-effects.
|Keywords||Modular interpreters, object algebras, implicit propagation|
|THEME||Software (theme 1)|
|Editor||C. Kästner (Christian) , A. Gokhālé (Aniruddha)|
|Series||ACM International Conference Proceeding Series|
|Project||Next Generation Auditing: Data- Assurance as a serivce|
|Conference||ACM International Conference on Generative Programming and Component Engineering|
Inostroza Valdera, P.A, & van der Storm, T. (2015). Modular Interpreters for the Masses: Implicit Context Propagation using Object Algebras. In C Kästner & A Gokhālé (Eds.), Proceedings of ACM International Conference on Generative Programming and Component Engineering 2015 (GPCE 0) (pp. 171–180). ACM.