Abstract
In this paper we argue that hand-writing a program generator generator has a number of advantages compared to generating a program generator generator by self-application of a partial evaluator. We show the basic principles of how to construct a program generator generator by presenting a program generator generator for a skeletal language, and we argue that it is not more difficult to use the direct approach than the indirect approach. Moreover, we report on some promising experiments made with a prototype implementation of a program generator generator for most of the Standard ML Core Language. To the best of our knowledge, our prototype is the first succesfully implemented hand-written program generator generator for a statically typed language.
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Lars Ole Andersen. C program specialization. Technical Report 92/14, DIKU, Department of Computer Science, University of Copenhagen, May 1992.
Lars Ole Andersen. Program Analysis and Specialization for the C Programming Language. PhD thesis, DIKU, Department fo Computer Science, University of Copenhagen, May 1994.
Andrew W. Appel. Compiling with Continuations. Cambridge University Press, 1992.
Lennart Beckman, Anders Haraldson, Östen Oskarsson, and Erik Sandewall. A partial evaluator and its use as a programming tool. In Artificial Intelligence 7, pages 319–357. North-Holland Publishing Company, 1976.
Lars Birkedal, Nick Rothwell, Mads Tofte, and David N. Turner. The ML Kit, Version 1. Technical Report 93/14, DIKU, University of Copenhagen, Denmark, 1993. The ML Kit is obtainable by anonymous ftp from ftp.diku.dk directory pub/diku/users/birkedal. This technical report is distributed along with the ML Kit.
Lars Birkedal and Morten Welinder. Partial evaluation of Standard ML. Technical Report 93/22, DIKU, October 1993.
Anders Bondorf. Self-Applicable Partial Evaluation. PhD thesis, DIKU, Department of Computer Science, University of Copenhagen, Universitetsparken 1, DK-2100 Copenhagen Ø, Denmark, December 1990.
Anders Bondorf. Automatic autoprojection of higher order recursive equations. Science of Computer Programming, 17:3–34, March 1991.
Anders Bondorf. Improving binding times without explicit CPS-conversion. In 1992 ACM Conference in Lisp and Functional Programming, San Francisco, California. (Lisp Pointers, vol. V, no. 1, 1992), pages 1–10. ACM, 1992.
Anders Bondorf, Neil D. Jones, Torben Mogensen, and Peter Sestoft. Binding time analysis and the taming of self-application. Draft, 18 pages, DIKU, University of Copenhagen, Denmark, August 1988.
Anders Bondorf and Jesper Jørgensen. Efficient analyses for realistic off-line partial evaluation. Journal of Functional Programming, special issue on partial evaluation, 3, July 1993.
Anne de Niel. Self-applicable Partial Evaluation of Polymorphically Typed Functional Languages. PhD thesis, Katholieke Universiteit Leuven, January 1993.
Y. Futamura. Partial evaluation of computation process — an approach to a compiler-compiler. Systems, Computers, Controls, 2(5):45–50, 1971.
Carsten K. Gomard. Higher order partial evaluation — HOPE for the lambda calculus. Master's thesis, DIKU, Universitetsparken 1, DK-2100 Copenhagen Ø, Denmark, 1989.
Carsten K. Gomard and Neil D. Jones. A partial evaluator for the untyped lambdacalculus. Journal of Functional Programming, 1(1):21–69, January 1991.
Fritz Henglein. Efficient type inference for higher-order binding-time analysis. In John Hughes, editor, Functional Programming Languages and Computer Architecture, Cambridge, Massachusetts, August 1991. (Lecture Notes in Computer Science, vol. 523), pages 448–472. Springer-Verlag, 1991.
Carsten Kehler Holst. Syntactic currying. Student report, DIKU, 1989.
Carsten Kehler Holst and John Launchbury. Handwriting cogen to avoid problems with static typing. Working Note, October 1992.
Neil D. Jones. Automatic program specialization: A re-examination from basic principles. In D. Björner, A. P. Ershov, and Neil D. Jones, editors, Partial Evaluation and Mixed Computation, pages 225–282. North-Holland, 1988.
Neil D. Jones. Efficient algebraic operations on programs. In AMAST: Algebraic Methodology and Software Technology, pages 245–267. University of Iowa, USA, 1991.
Neil D. Jones, Carsten K. Gomard, and Peter Sestoft. Partial Evaluation and Program Generation. Prentice-Hall, 1993.
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.
John Launchbury. A strongly-typed self-applicable partial evaluator. In John Hughes, editor, Functional Programming Languages and Computer Architecture, Lecture Notes in Computer Science. ACM, Springer-Verlag, 1991.
Mark Leone and Peter Lee. Deferred compilation: The automation of run-time code generation. Technical Report CMU-CS-93-225, Carnegie Mellon University, December 1993.
Morten Marquard and Bjarne Steensgaard. Partial evaluation of an object-oriented imperative language. Master's thesis, DIKU, University of Copenhagen, Denmark, 1992.
U. Meyer. Techniques for partial evaluation of imperative languages. In Partial Evaluation and Semantics-Based Program Manipulation, New Haven, Connecticut. (Sigplan Notices, vol. 26, no. 9, September 1991), pages 94–105. ACM, 1991.
Robin Milner and Mads Tofte. Commentary on Standard ML. MIT Press, 1991.
Robin Milner, Mads Tofte, and Robert Harper. The Definition of Standard ML. MIT Press, 1990.
Torben Æ. Mogensen. Constructor specialization. In Proceedings of the ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation, pages 22–33, 1993.
Hanne Riis Nielson and Flemming Nielson. Automatic binding time analysis for a typed λ-calculus. Science of Computer Programming, 10:139–176, 1988.
D. Weise, R. Conybeare, E. Ruf, and S. Seligman. Automatic online partial evaluation. In John Hughes, editor, Functional Programming Languages and Computer Architecture, Cambridge, Massachusetts, August 1991. (Lecture Notes in Computer Science, vol. 523), pages 165–191. ACM, Springer-Verlag, 1991.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1994 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Birkedal, L., Welinder, M. (1994). Hand-writing program generator generators. In: Hermenegildo, M., Penjam, J. (eds) Programming Language Implementation and Logic Programming. PLILP 1994. Lecture Notes in Computer Science, vol 844. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-58402-1_15
Download citation
DOI: https://doi.org/10.1007/3-540-58402-1_15
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-58402-5
Online ISBN: 978-3-540-48695-4
eBook Packages: Springer Book Archive