skip to main content
10.1145/2635648.2635652acmotherconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
research-article

Eager Evaluation Isn't Eager Enough A Transformation Based Approach to Semantics-Directed Code Generation

Authors Info & Claims
Published:14 August 2014Publication History

ABSTRACT

An interpreter is a concise definition of the semantics of a programming language and is easily implemented. A compiler is more difficult to construct, but the code that it generates runs faster than interpreted code. This paper introduces rules for staging an interpreter so that it generates a compiler. An extended example suggests the utility of the technique. The rules are described formally and correctness is discussed. Finally, this technique is compared to staging and partial evaluation.

References

  1. L. Birkedal, M. Welinder. Hand-Writing Program Generator Generators. Programming Language Implementation and Logic Programming, Springer, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. R. M. Bustall, J. Darlington. A Transformation System for Developing Recursive Programs. Journal of the ACM, Vol. 24, No. 1, 44--67, 1977. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. C. Consel. A Tour of Schism: A Partial Evaluation System for Higher-Order Applicative Languages. Proceedings of the 1993 ACM SIGPLAN symposium on Partial evaluation and semantics-based program manipulation, 145--154, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. C. Consel. New Insights into Partial Evaluation: The Schism Experiment. Lecture Notes in Computer Science, Vol. 300, 236--246, Springer-Verlag, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. O. Danvy, H. K. Rohde. On Obtaining the Boyer-Moore String-Matching Algorithm by Partial Evaluation. Information Processing Letters, Vol. 99, No. 4, 158--162, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. O. Danvy and R. Vestergaard. Semantics Based Compiling: A Case Study in Type Directed Partial Evaluation. Eighth International Symposium on Programming Language Implementation and Logic Programming, 182--497, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. M. Feeley, G. LaPalme. Using Closures for Code Generation. Computer Language, Vol. 12, No. 1, 47--66, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Y. Futamura. Partial Evaluation of Computation Process -- An Approach to a Compiler-Compiler. Systems, Computers, Controls, Vol. 2, No. 5, 45--50, 1971.Google ScholarGoogle Scholar
  9. C. A. Gunter. Semantics of Programming Languages: Structures and Techniques. MIT Press, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. N. D. Jones. Personal Communication, 2013.Google ScholarGoogle Scholar
  11. N. D. Jones, C. K. Gomard, P. Sestoft, L. O. Andersen, T. Mogensen. Partial Evaluation and Automatic Program Generation. Prentice Hall International, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. U. Jørring, W. L. Scherlis. Compilers and Staging Transformations. Symposium on Principles of Programming Languages, 86--96, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. R. Kelsey, W. Clinger, J. Rees editors. Revised5 Report on the Algorithmic Language Scheme. ACM SIGPLAN Notices, Vol. 33, No. 9, 26--76, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. E. Moggi, W. Taha, Z. Benaissa, T. Sheard. An Idealized MetaML: Simpler, and More Expressive. Proeedings of the European Symposium on Programming, 193--207, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. A. Nanevski, F. Pfenning. Staged Computation with Names and Necessity. Journal of Functional Programming, Vol. 15, No. 6, 893--939, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. J. E. Stoy. Denotational Semantics: The Scott-Strachey Approach to Programming Language Theory. MIT Press, 1981. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. W. Taha. Multi-Stage Programming: Its Theory and Applications. PhD thesis, Oregon Graduate Institute of Science and Technology, Hillsboro, Oregon, USA, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. P. J. Thiemann. Cogen in Six Lines. ACM SIGPLAN Notices, Vol. 31, No. 6. ACM, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. P. J. Thiemann. The PGG system--user manual. 2000.Google ScholarGoogle Scholar
  20. F. Turbak, D. Gifford, M. A. Sheldon. Design Concepts in Programming Languages. MIT Press, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Eager Evaluation Isn't Eager Enough A Transformation Based Approach to Semantics-Directed Code Generation

    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 Other conferences
      ILC '14: Proceedings of ILC 2014 on 8th International Lisp Conference
      August 2014
      108 pages
      ISBN:9781450329316
      DOI:10.1145/2635648
      • General Chair:
      • Marc Feeley,
      • Program Chair:
      • Didier Verna

      Copyright © 2014 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 the author(s) 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: 14 August 2014

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • research-article
      • Research
      • Refereed limited

      Acceptance Rates

      ILC '14 Paper Acceptance Rate18of26submissions,69%Overall Acceptance Rate18of26submissions,69%
    • Article Metrics

      • Downloads (Last 12 months)2
      • Downloads (Last 6 weeks)0

      Other Metrics

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader