Compiling Adaptive Programs by Partial Evaluation

  • Authors:
  • Peter Thiemann

  • Affiliations:
  • -

  • Venue:
  • CC '00 Proceedings of the 9th International Conference on Compiler Construction
  • Year:
  • 2000

Quantified Score

Hi-index 0.00

Visualization

Abstract

An adaptive program is an object-oriented program which is abstracted over the particular class structure.Th is abstraction fosters software reuse, because programmers can concentrate on specifying how to process the objects which are essential to their application. The compiler of an adaptive program takes care of actually locating the objects. The adaptive programmer merely writes a traversal specification decorated with actions. The compiler instantiates the specification with the actual class structure and generates code that traverses a collection of objects, performing visits and actions according to the specification. Earlier work on adaptive programming merely stated but never verified that compilation of adaptive programs is nothing but partial evaluation. We employ an algebraic framework based on derivatives of traversal specifications to develop an interpretive semantics of adaptive programming. This semantics is naturally staged in up to three stages. Compilation can be achieved using a standard partial evaluator. Slight changes in the binding-time properties yield several variants of the compiler, by trading compile-time computations for run-time computations.