|
ABSTRACT
A major obstacle in partial evaluation (program specialization) is the need for binding time improvements. By reorganizing a source program, the residual programs obtained by specializing the source program may be improved: more computations can be done statically, that is, at specialization time.
One well-known effective reorganization is (manual or automatic) conversion into continuation passing style (cps). This conversion allows data consumers to be propagated through frozen expressions to the data producers. In this paper we show how such improvements can be obtained without affecting the source program: by writing the program specializer itself in cps; traditionally, specialization has been formulated in direct style.
The advantages of avoiding cps-converting source programs are: (1) no cps-conversion phase is needed; (2) the generated residual programs are not in cps; (3) since no source level continuations are added, there is no overhead of manipulating closure representations in the generating extensions (e.g. compilers) obtained by self-application; (4) manual “binding time debugging” is easier since binding time analysis is done on a non-converted program.
We have implemented a cps-based program specializer; it is integrated in the partial evaluator Similix 4.0.
Using a cps-specializer, partially static data structures can be handled safely in a straightforward way. The difficulty is to ensure automatically that residual expressions that become part of a partially static data structure are neither duplicated nor discarded. This is achieved by binding such residual expressions in automatically inserted frozen let-expressions; cps is needed to propagate operations on the partially static data structure through these frozen let-expressions. Based on this idea, we have implemented an extension of Similix 4.0 that handles partially static data structures.
REFERENCES
Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.
| |
BD91
|
|
| |
Bon91a
|
|
| |
Bon91b
|
Anders Bondorf. Similix Manual, system version j.O. DIKU, University of Copenhagen, Denmark, September 1991.
|
| |
CD91
|
|
 |
Con90a
|
|
| |
Con90b
|
Charles Consel. The Schism Manual. Yale University, New Haven, Connecticut, USA, 1990. Version 1.0.
|
| |
Dan91
|
|
| |
Dan92
|
|
| |
GJ91a
|
Carsten K. Gomard and Neil D. Jones. Compiler generation by partial evaluation: a case study. Structured Programming, 12:123-144, 1991.
|
| |
GJ91b
|
Carsten K. Gomard and Neil D. Jones. A partial evaluator for the untyped lambda-calculus. Journal of Functional Programming, 1(1):21-69, January 1991.
|
 |
HG91
|
|
| |
HH90
|
Carsten Kehler Hoist and John Hughes. Towards binding-time improvement for free. in Simon L. Pcytoxt Jones, Graham Hutton, and Carsten K ehler Hoist, editors, Functional Programming, Glasgow 1990. Workshops in Computing, pages 83-100, Springer-Verlag, August 1990.
|
| |
IEE90
|
|
| |
Jor90
|
Jesper Jorgensen. Generating a pattern matching compiler by partial evaluation. In Simon L. Peyton Jones, Graham Hutton, and Carsten Kehler Hoist, editors, Functional Programming, Glasgow 1990. Workshops in Computing, pages 177-195, Springer-Verlag, August 1990.
|
 |
Jor92
|
|
| |
JSS89
|
Neil D. Jones, Peter Sestoft, and Harald Sendergaard. MIX: a self-applicable partial evahator for experiments in compiler generation. LISP and Symbolic Computation, 2(1):9-50, 1989.
|
 |
KS91
|
|
| |
Lau91
|
|
| |
Mog88
|
Torben _/E. M ogensen. Partially static structures in a self-applicable partial evaluator. In Dines Bjgtrner, Andrei P. Ershov, and Nell D. Jones, editors, Partial Evaluation and Mixed Computation, pages 325-347, North-Holland, 1988.
|
| |
Mog89
|
Torben }E. Mogensen. Binding Time Aspects of Partial Evaluation. PhD thesis, DIKU, University of Copenhagen, Denmark, March 1989.
|
 |
NN88
|
|
| |
Ses88
|
Peter Sestoft. Automatic call unfolding in a partial evahator. In Dines Bjorner, Andrei P. Ershov, and Neil D. Jones, editors, Partial Evaluation and Mixed Computation, pages 485-506, North-Holland, 1988.
|
| |
Ste78
|
|
| |
WCRS91
|
Daniel Weise , Roland Conybeare , Erik Ruf , Scott Seligman, Automatic online partial evaluation, Proceedings of the 5th ACM conference on Functional programming languages and computer architecture, p.165-191, June 1991, Cambridge, Massachusetts, United States
|
|