Abstract
Our aim is to study how the interpretive approach — inserting an interpreter between a source program and a program specializer — can be used to improve the transformation of programs and to automatically generate program transformers by self-application of a program specializer.
We show that a few semantics-preserving transformations applied to a straightforward interpretive definition of a first-order, call-by-name language are sufficient to generate Wadler's deforestation algorithm and a version of Turchin's supercompiler using a partial evaluator. The transformation is guided by the need to binding-time improve the interpreters.
Supported by an Erwin-Schrödinger-Fellowship of the Austrian Science Foundation (FWF) under grant J0780 & J0964.
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Rod M. Burstall, and John Darlington. A transformation system for developing recursive programs. Journal of the ACM, 24(1):44–67, 1977.
Anders Bondorf. Compiling laziness by partial evaluation. In [JHH91]. Springer-Verlag, August 1991., pages 9–22, 1991.
Anders Bondorf. Similix 5.0 Manual. DIKU, University of Copenhagen, Denmark, May 1993. Included in Similix distribution, 82 pages.
Yoshihiko Futamura. Partial evaluation of computing process — an approach to a compiler-compiler. Systems, Computers, Controls, 2(5):45–50, 1971.
Robert Glück and Jesper Jørgensen. Generating optimizing specializers. In IEEE International Conference on Computer Languages, pages 183–194. IEEE Computer Society Press, 1994.
Robert Glück and Andrei V. Klimov. Occam's razor in metacomputation: the notion of a perfect process tree. In P. Cousot, M. Falaschi, G. Filè, and G. Rauzy, editors, Static Analysis. Proceedings. Lecture Notes in Computer Science, Vol. 724, pages 112–123. Springer-Verlag, 1993.
Robert Glück. On the generation of S→R-specializers. Technical report, University of Technology Vienna, 1991. (Presented at the NYU Partial Computation and Program Analysis Day. June 21, 1991, New York).
Robert Glück. On the generation of specializers. Journal of Functional Programming, 4(3):(to appear), 1994.
Carsten K. Gomard. A self-applicable partial evaluator for the lambda calculus: correctness and pragmatics. ACM TOPLAS, 14(2):147–172, 1992.
Neil D. Jones, Carsten K. Gomard, and Peter Sestoft. Partial Evaluation and Automatic Program Generation. Prentice-Hall, 1993.
Simon L. Peyton Jones, Graham Hutton, and Carsten Kehler Holst, editors. Functional Programming, Glasgow 1990. Workshops in Computing. Springer-Verlag, August 1991.
Jesper Jørgensen. Generating a pattern matching compiler by partial evaluation. In [JHH91], pages 177–195, 1991.
Jesper Jørgensen. Generating a compiler for a lazy language by partial evaluation. In Nineteenth Annual ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages. Albuquerque, New Mexico, pages 258–268, January 1992.
Neil D. Jones, Peter Sestoft, and Harald Søndergaard. An experiment in partial evaluation: the generation of a compiler generator. In J.-P. Jouannaud, editor, Rewriting Techniques and Applications, Dijon, France. Lecture Notes in Computer Science 202, pages 124–140. Springer-Verlag, 1985.
Neil D. Jones, Peter Sestoft, and Harald Søndergaard. Mix: a self-applicable partial evaluator for experiments in compiler generation. LISP and Symbolic Computation, 2(1):9–50, 1989.
David Sands. Total correctness and improvement in the transformation of functional programs. Unpublished, May 1994.
Peter Sestoft. Automatic call unfolding in a partial evaluator. In Dines Bjørner, Andrei P. Ershov, and Neil D. Jones, editors, Partial Evaluation and Mixed Computation, pages 485–506. North-Holland, 1988.
Morten Heine Sørensen, Robert Glück, and Neil D. Jones. Towards unifying partial evaluation, deforestation, supercompilation, and GPC. In Donald Sannella, editor, Programming Languages and Systems — ESOP'94. Proceedings, volume 788 of Lecture Notes in Computer Science, pages 485–500, Edinburgh, Scotland, 1994. Springer-Verlag.
Valentin F. Turchin. The use of metasystem transition in theorem proving and program optimization. In J. W. de Bakker, and J. van Leeuwen, editors, Automata, Languages and Programming, volume 85 of Lecture Notes in Computer Science, pages 645–657, Noordwijkerhout, Netherlands, 1980. Springer-Verlag.
Valentin F. Turchin. The concept of a supercompiler. Transactions on Programming Languages and Systems, 8(3):292–325, 1986.
Valentin F. Turchin. Program transformation with metasystem transitions. Journal of Functional Programming, 3(3):283–313, 1993.
Philip Wadler. Deforestation: transforming programs to eliminate trees. Theoretical Computer Science, 73:231–248, 1990.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1994 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Glück, R., Jørgensen, J. (1994). Generating transformers for deforestation and supercompilation. In: Le Charlier, B. (eds) Static Analysis. SAS 1994. Lecture Notes in Computer Science, vol 864. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-58485-4_57
Download citation
DOI: https://doi.org/10.1007/3-540-58485-4_57
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-58485-8
Online ISBN: 978-3-540-49005-0
eBook Packages: Springer Book Archive