skip to main content
10.1145/143165.143220acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
Article
Free Access

Generating a compiler for a lazy language by partial evaluation

Published:01 February 1992Publication History

ABSTRACT

Compiler generation is often emphasized as being the most important application of partial evaluation. But most of the larger practical applications have, to the best of our knowledge, been outside this field. Expecially, no one has generated compilers for languages other than small languages. This paper describes a large application of partial evaluation where a realistic compiler was generated for a strongly typed lazy functional language. The language, that was called BAWL, was modeled after the language in Bird and Wadler [BW88] and is a combinator language with pattern matching, guarded alternatives, local definitions and list comprehensions. The paper describes the most important techniques used, especially the binding time improvements needed in order to get small and efficient target programs. Finally, the performance of the compiler is compared with two compilers for similar languages: Miranda and LML.

References

  1. BD91.Anders Bondorf and Olivier Danvy. Automatic autoprojection of recursive equations with global variables and abstract data types. Science of Computer Programming, 16, 1991. To appear. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Bon90.Anders Bondorf. Automatic autoprojection of higher order recursive equations. In Nell D. Jones, editor, ESOP'90, Copenhagen, Denmark. Lecture Notes in Computer Science ~32, pages 70-87, Springer-Verlag, May 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Bon91a.Anders Bondorf. Compiling laziness by partial evaluation. In {JHH91}, pages 9-22, 1991.Google ScholarGoogle Scholar
  4. Bon91b.Anders Bondorf. Similix manual, system version 4.0. Included in Similix distribution, September 1991.Google ScholarGoogle Scholar
  5. Bon92.Anders Bondorf. Improving binding times without explicit cps-conversion. 1992. Forthcoming.Google ScholarGoogle Scholar
  6. BW88.Richard Bird and Philip Wadler. Introduction to Functional Programming. Computer Science, Prentice-Hall, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. CD89.Charles Consel and Olivier Danvy. Partial evaluation of pattern matching in strings. Information Processing Letters, 30(2):79-86, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Con88.Charles Consel. New insights into partial evaluation: the schism experiment. In Harald Ganzinger, editor, ESOP'88, Nancy, France. Lecture Notes in Computer Science 300, pages 236-247, Springer-Verlag, March 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Dan91.Olivier Danvy. Semantics-directed compilation of nonlinear patterns. Information Processing Letters, 37(6):315-322, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. GJ89.Carsten K. Gomard and Nell D. Jones. Compiler generation by partial evaluation: a case study. In Proceedings of the Twelfth IFIP World Computer Congress, 1989.Google ScholarGoogle Scholar
  11. HG91.Carsten Kehler Holst and Carsten K. Gomard. Partial evaluation is fuller laziness. In Symposium on Partial Evaluation and Semantics- Based Program Manipulation, Yale University, New Haven, Connecticut. SIGPLAN Notices, volume P6, 9, pages 223-233, ACM Press, June 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. HH91.Carsten Kehler Hoist and John Hughes. Towards binding-time improvement for free. In {JHH91}, pages 83-100, 1991.Google ScholarGoogle Scholar
  13. HW90.Paul Hudak and Philip Wadler. Report on the programming language Haskell. Technical Report, Yale University and Glasgow University, April 1990.Google ScholarGoogle Scholar
  14. JHH91.Simon L. Peyton Jones, Graham Hutton, and Carsten Kehler Holst, editors. Functional Programming, Glasgow 1990. Workshops in Computing, Springer-Verlag, August 1991.Google ScholarGoogle Scholar
  15. Joh75.S.C. Johnson. YACC: Yet another compiler compiler. Technical Report 32, Bell laboratories, Murray Hill, New Jersey, 1975.Google ScholarGoogle Scholar
  16. Jor91a.Jesper Jergensen. Compiler Generation by Partial Evaluation. Master's thesis, DIKU, University of Copenhagen, Denmark, student report, October 1991. Forthcoming.Google ScholarGoogle Scholar
  17. Jor91b.Jesper Jergensen. Generating a pattern matching compiler by partial evaluation. In {JHH91}, pages 177-195, 1991.Google ScholarGoogle Scholar
  18. JSS85.Nell D. Jones, Peter Sestoft, and Harald Sendergaard. 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. Google ScholarGoogle Scholar
  19. JSS89.Nell D. Jones, Peter Sestoft, and Harald Sendergaard. Mix: a self-applicable partial evaluator for experiments in compiler generation. LISP and Symbolic Computation, 2(1):9-50, 1989.Google ScholarGoogle ScholarCross RefCross Ref
  20. MTH90.Robin Milner, Mads Tofte, and Robert Harper. The definition o.f Standard ML. MIT Press, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. RC86.Jonathan Rees and William Clinger. Revised report3 on the algorithmic language scheme. Sig. plan Notices, 21(12):37-79, December 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Rom88.Sergei A. Romanenko. A compiler generator produced by a self-applicable specialiser can have a surprisingly natural and understandable structure. In Dines Bjerner, Andrei P. Ershov, and Nell D. Jones, editors, Partial Evaluation and Mixed Computation, pages 445-463, North- Holland, 1988.Google ScholarGoogle Scholar
  23. Sch86.David A. Schmidt. Denotational Semantics, a Methodology for Language Development. Allyn and Bacon, Boston, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Ses85.Peter Sestoft. The structure of a self-applicable partial evaluator. In Harald Ganzinger and D. Jones, editors, Programs as Data Objects, Copenhagen, Denmark. Lecture Notes in Computer Science 217, pages 236-256, Springer- Verlag, October 1985. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Tur82.David Turner. Recursion equations as a programming language. In Darlington et al., editor, Functional Programming and Its Applications., pages 1-28, Cambridge University Press, 1982.Google ScholarGoogle Scholar
  26. Tur86.David Turner. An overview of Miranda. Sigplan Notices, 21(12):158-166, December 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Wad85.Philip Wadler. Introduction to Orwell. Technical Report, Programming Research Group, University of Oxford, 1985.Google ScholarGoogle Scholar

Index Terms

  1. Generating a compiler for a lazy language by partial evaluation

                Recommendations

                Comments

                Login options

                Check if you have access through your login credentials or your institution to get full access on this article.

                Sign in
                • Published in

                  cover image ACM Conferences
                  POPL '92: Proceedings of the 19th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
                  February 1992
                  376 pages
                  ISBN:0897914538
                  DOI:10.1145/143165
                  • Chairman:
                  • Ravi Sethi

                  Copyright © 1992 ACM

                  Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

                  Publisher

                  Association for Computing Machinery

                  New York, NY, United States

                  Publication History

                  • Published: 1 February 1992

                  Permissions

                  Request permissions about this article.

                  Request Permissions

                  Check for updates

                  Qualifiers

                  • Article

                  Acceptance Rates

                  POPL '92 Paper Acceptance Rate30of204submissions,15%Overall Acceptance Rate824of4,130submissions,20%

                  Upcoming Conference

                  POPL '25

                PDF Format

                View or Download as a PDF file.

                PDF

                eReader

                View online with eReader.

                eReader