Model Interpretation and Compilation by Partial Evaluation

EPFL IC Tresor talks

by William Cook In model-driven development, the use of both model translators and model interpreters is widespread. It is also well-known that partial evaluation can turn an interpreter into a translator. In this paper we show that a simple online partial evaluator is effective at specializing a model interpreter with respect to a model to create a compiled model interpretation. Data models pose a particular problem, because it is not clear what a data model interpreter would do, given that data is generally considered to be passive. We show how a data model interpreter can be defined in an object-oriented style as a dynamic message-processing function. Partial evaluation can then be applied to this data model interpreter to create a static dispatch function, analogous to a normal static class definition. We also consider the case of user interface model interpreters, and show that partial evaluation and deforestation can produce good specialized code. The user interface interpreter illustrates a solution to integrating two modeling languages. The system described here is bootstrapped from Scheme, although the goal is to build a complete software development environment based on model interpreters.