Automatically achieving elasticity in the implementation of programming languages
Michael Horowitz · 1988
Several developments in programming language design and software engineering lead to a reexamination of the role of binding times in programming language implementation. We can alleviate problems associated with these developments by using event-driven processing to determine translation binding times. Our ultimate goal is to clarify the effects of different designs on binding times and to reduce binding time concerns during language design. The determination of translation action binding times must correctly order the action's execution relative to other actions and compute the phase of its execution (e.g. compile-time, link-time, or run-time). Issues include how to handle forward references, language designs that require interpretation, the role of link-time, and how to achieve elasticity. Elasticity occurs when similar translation actions are executed at different times, typically in different translation phases. Elastic translation can incur the costs of late bindings only when language flexibility is actually used by the programmer. The programmer otherwise receives the benefits associated with static translation (e.g. early error notification and efficient program execution). Elasticity is indicated in the design of programming environments and command languages. We can model language translation as an event-driven process. Each semantic action needed for translating a program may be viewed as an event. Each event becomes enabled when its required data becomes available. Event-driven translation progresses by executing those events initially enabled and continuing with those enabled as a result. Since each action is handled individually, event-driven translation naturally determines proper binding times and achieves elasticity. We can also generate event-driven translation systems automatically. Automatic generation removes from the language implementor the need to understand the event-driven model. Event-driven translators can be generated from a known specification formalism, attributed grammmars. A generator of event-driven translators can also provide useful information about binding times during language design. Finally, event-driven translators may have potential in practical language implementations. We describe the event-driven translation model, a generator of event-driven translators, a language design based on elasticity, and an evaluation of the model's potential for practicality. We also discuss the impact of elasticity on language design and the role event-driven translation can play in evaluating designs.