Automatic Online Partial Evaluation

We have solved the problem of constructing a fully automatic online program specializer for an untyped functional language (specifically, the functional subset of Scheme). We designed our specializer, called Fuse, as an interpreter that returns a trace of suspended computations. The trace is represented as a graph, rather than as program text, and each suspended computation indicates the type of its result. A separate process translates the graph into a particular programming language. Producing graphs rather than program text solves problems with code duplication and premature reduce/residualize decisions. Fuse's termination strategy, which employs online generalization, specializes conditional recursive function calls, and unfolds all other calls. This strategy is shown to be both powerful and safe.

[1]  Neil D. Jones,et al.  Mix: A self-applicable partial evaluator for experiments in compiler generation , 1989, LISP Symb. Comput..

[2]  Gerald J. Sussman,et al.  Structure and interpretation of computer programs , 1985, Proceedings of the IEEE.

[3]  Anders Haraldsson A program manipulation system based on partial evaluation , 1977 .

[4]  R. Schooler,et al.  PARTIAL EVALUATION AS A MEANS OF LANGUAGE EXTENSIBILITY , 1984 .

[5]  Jr. Guy L. Steele,et al.  Rabbit: A Compiler for Scheme , 1978 .

[6]  Valentin F. Turchin,et al.  The concept of a supercompiler , 1986, TOPL.

[7]  Andrew A. Berlin,et al.  Partial evaluation applied to numerical computation , 1990, LISP and Functional Programming.

[8]  Andrei P. Ershov,et al.  On the Partial Computation Principle , 1977, Inf. Process. Lett..

[9]  Andrew Berlin A Compilation Strategy for Numerical Programs Based on Partial Evaluation , 1989 .

[10]  Peter Sestoft,et al.  An experiment in partial evaluation: the generation of a compiler generator , 1985, SIGP.

[11]  Olivier Danvy,et al.  From Interpreting to Compiling Binding Times , 1990, ESOP.

[12]  Mark W. Perlin,et al.  Call-Graph Caching: Transforming Programs into Networks , 1989, IJCAI.

[13]  Charles Consel,et al.  Binding time analysis for high order untyped functional languages , 1990, LISP and Functional Programming.

[14]  Anders Bondorf,et al.  Automatic Autoprojection of Recursive Equations with Global Variables and Abstract Data Types , 1991, Sci. Comput. Program..

[15]  Andrew A. Berlin,et al.  Compiling scientific code using partial evaluation , 1990, Computer.

[16]  Olivier Danvy,et al.  Partial Evaluation of Pattern Matching in Strings , 1989, Inf. Process. Lett..

[17]  Anders Bondorf,et al.  Automatic Autoprojection of Higher Order Recursive Equations , 1990, Sci. Comput. Program..

[18]  Erik Ruf,et al.  Computing Types During Program Specialization , 1990 .

[19]  Erik Ruf,et al.  Using types to avoid redundant specialization , 1991, PEPM '91.

[20]  John Darlington,et al.  A Transformation System for Developing Recursive Programs , 1977, J. ACM.

[21]  Erik Sandewall,et al.  A Partial Evaluator, and its Use as a Programming Tool , 1976, Artif. Intell..

[22]  Charles Consel,et al.  New Insights into Partial Evaluation: the SCHISM Experiment , 1988, ESOP.