Continuation-Based Partial Evaluation without Continuations

Peter Thiemann. Continuation-Based Partial Evaluation without Continuations. In Radhia Cousot, editor, Static Analysis, 10th International Symposium, SAS 2003, San Diego, CA, USA, June 11-13, 2003, Proceedings. Volume 2694 of Lecture Notes in Computer Science, pages 366-382, Springer, 2003. [doi]

Abstract

Continuation-based partial evaluation is an implementation technique for program specializers that allows generated code contexts to commute with specialization-time values. Thus it enables additional specialization-time computations. Its most general implementation known to date is based on the manipulation of continuations. We show that a substitution monad provides an alternative implementation of the context manipulation performed by continuation-based partial evaluation. We prove its equivalence to the original continuation-based implementation. A type-based binding-time analysis that is augmented with effects provides static information about the generated code contexts. We prove the soundness of the resulting type and effect system with respect to our implementation and point out how a binding-time analysis extended with this effect information may avoid code duplication and enable the generation of more efficient generating extensions.