Peter Thiemann1
Date:
The programming language Scheme [22] is an ideal vehicle for meta-computation, specifically for partial evaluation. Part of the appropriateness of Scheme for meta-computation tasks derives from its reflective features: eval, which reflects the external representation of, say, a procedure to a functional value, apply, which reflects lists to argument lists, and call/cc2, which makes the continuation of the current expression available as a procedure. The continuation can be viewed as a reified object from the meta-interpreter (supposedly written in CPS).
Much work in partial evaluation has been done in the context of Scheme [3,6,7,5,8]. However, its reflective features have been neglected so far. In order to overcome this drawback, we present a binding-time analysis and a specialization algorithm for a large functional subset of Scheme. The subset includes eval, apply, and call/cc. Additionally, our new analysis supports variadic functions and includes a representation analysis which treats external and built-in operators more liberal than previous analyses. The latter analysis improves the efficiency of the specializer by enabling it to choose the most efficient representation for functions and objects of algebraic datatypes. These features are unique to our specializer.