Skip to main content

Hand-writing program generator generators

  • Conference paper
  • First Online:
Programming Language Implementation and Logic Programming (PLILP 1994)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 844))

  • 311 Accesses

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Similar content being viewed by others

References

  1. Lars Ole Andersen. C program specialization. Technical Report 92/14, DIKU, Department of Computer Science, University of Copenhagen, May 1992.

    Google Scholar 

  2. Lars Ole Andersen. Program Analysis and Specialization for the C Programming Language. PhD thesis, DIKU, Department fo Computer Science, University of Copenhagen, May 1994.

    Google Scholar 

  3. Andrew W. Appel. Compiling with Continuations. Cambridge University Press, 1992.

    Google Scholar 

  4. 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.

    Google Scholar 

  5. 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.

    Google Scholar 

  6. Lars Birkedal and Morten Welinder. Partial evaluation of Standard ML. Technical Report 93/22, DIKU, October 1993.

    Google Scholar 

  7. Anders Bondorf. Self-Applicable Partial Evaluation. PhD thesis, DIKU, Department of Computer Science, University of Copenhagen, Universitetsparken 1, DK-2100 Copenhagen Ø, Denmark, December 1990.

    Google Scholar 

  8. Anders Bondorf. Automatic autoprojection of higher order recursive equations. Science of Computer Programming, 17:3–34, March 1991.

    Google Scholar 

  9. 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.

    Google Scholar 

  10. 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.

    Google Scholar 

  11. 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.

    Google Scholar 

  12. Anne de Niel. Self-applicable Partial Evaluation of Polymorphically Typed Functional Languages. PhD thesis, Katholieke Universiteit Leuven, January 1993.

    Google Scholar 

  13. Y. Futamura. Partial evaluation of computation process — an approach to a compiler-compiler. Systems, Computers, Controls, 2(5):45–50, 1971.

    Google Scholar 

  14. Carsten K. Gomard. Higher order partial evaluation — HOPE for the lambda calculus. Master's thesis, DIKU, Universitetsparken 1, DK-2100 Copenhagen Ø, Denmark, 1989.

    Google Scholar 

  15. Carsten K. Gomard and Neil D. Jones. A partial evaluator for the untyped lambdacalculus. Journal of Functional Programming, 1(1):21–69, January 1991.

    Google Scholar 

  16. 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.

    Google Scholar 

  17. Carsten Kehler Holst. Syntactic currying. Student report, DIKU, 1989.

    Google Scholar 

  18. Carsten Kehler Holst and John Launchbury. Handwriting cogen to avoid problems with static typing. Working Note, October 1992.

    Google Scholar 

  19. 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.

    Google Scholar 

  20. Neil D. Jones. Efficient algebraic operations on programs. In AMAST: Algebraic Methodology and Software Technology, pages 245–267. University of Iowa, USA, 1991.

    Google Scholar 

  21. Neil D. Jones, Carsten K. Gomard, and Peter Sestoft. Partial Evaluation and Program Generation. Prentice-Hall, 1993.

    Google Scholar 

  22. 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.

    Google Scholar 

  23. 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.

    Google Scholar 

  24. 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.

    Google Scholar 

  25. Morten Marquard and Bjarne Steensgaard. Partial evaluation of an object-oriented imperative language. Master's thesis, DIKU, University of Copenhagen, Denmark, 1992.

    Google Scholar 

  26. 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.

    Google Scholar 

  27. Robin Milner and Mads Tofte. Commentary on Standard ML. MIT Press, 1991.

    Google Scholar 

  28. Robin Milner, Mads Tofte, and Robert Harper. The Definition of Standard ML. MIT Press, 1990.

    Google Scholar 

  29. Torben Æ. Mogensen. Constructor specialization. In Proceedings of the ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation, pages 22–33, 1993.

    Google Scholar 

  30. Hanne Riis Nielson and Flemming Nielson. Automatic binding time analysis for a typed λ-calculus. Science of Computer Programming, 10:139–176, 1988.

    Google Scholar 

  31. 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.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Manuel Hermenegildo Jaan Penjam

Rights and permissions

Reprints 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

Publish with us

Policies and ethics