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

Continuation-passing, closure-passing style

Authors Info & Claims
Published:03 January 1989Publication History

ABSTRACT

We implemented a continuation-passing style (CPS) code generator for ML. Our CPS language is represented as an ML datatype in which all functions are named and most kinds of ill-formed expressions are impossible. We separate the code generation into phases that rewrite this representation into ever-simpler forms. Closures are represented explicitly as records, so that closure strategies can be communicated from one phase to another. No stack is used. Our benchmark data shows that the new method is an improvement over our previous, abstract-machine based code generator.

References

  1. 1.Andrew W. Appel and David B. Mac- Queen, "A Standard ML compiler," in Functional Programming Languages and Computer Architecture (LNCS 274), pp. 301-324, Springer-Verlag, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. 2.Guy L. Steele, "Rabbit: a compiler for Scheme," AI-TR-474, MIT, 1978. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. 3.D. Kranz, R. Kelsey, J. Rees, P. Hudak, J. Philbin, and N. Adams, "ORBIT: An optimizing compiler for Scheme," Proc. Sigplan '86 Syrup. on Compiler Construction, vol. 21 (Sigplan Notices), no. 7, pp. 219-233, July 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. 4.David Kranz, "ORBIT: An Optimizing Compiler for Scheme," PhD Thesis, Yale University, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. 5.Andrew W. Appel, Christopher W. Fraser, David R. Hanson, and Arthur H. Watson, "Generating code for the Case statement," in preparation.Google ScholarGoogle Scholar
  6. 6.V. Vyssotsky and P. Wegner, A graph theoretical Fortran source language analyzer, AT&T Bell Laboratories, Murray Hill, NJ, 1963.Google ScholarGoogle Scholar
  7. 7.G. Cousineau, P. L. Curien, and M. Mauny, "The Categorical Abstract Machine," in Functional Programming Languages and Computer Architecture, LNCS Vol 201, ed. J. P. Jouannaud, pp. 50-64, Springer- Verlag, 1985. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. 8.Andrew W. Appel and Trevor Jim, "Optimizing closure environment representations," CS-TR- 168-88, Princeton University, 1988.Google ScholarGoogle Scholar
  9. 9.David Ungar, "Generation scavenging: a non-disruptive high performance storage reclamation algorithm," SIGPLAN Notices (Proc. ACM SIGSOFTISIGPLAN Software Eng. Syrup. on Practical Software Development Environments), vol. 19, no. 5, pp. 157-167, ACM, 1984. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. 10.A.W. Appel, "Garbage collection can be faster than stack allocation," Information Processing Letters, vol. 25, no. 4, pp. 275- 279, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. 11.David R. Chase, "Safety considerations for storage allocation optimizations," SIG- PLAN '88 Conf. on Prog. Lang. Design and Implementation, pp. 1-10, ACM, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Continuation-passing, closure-passing style

          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 '89: Proceedings of the 16th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
            January 1989
            352 pages
            ISBN:0897912942
            DOI:10.1145/75277

            Copyright © 1989 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: 3 January 1989

            Permissions

            Request permissions about this article.

            Request Permissions

            Check for updates

            Qualifiers

            • Article

            Acceptance Rates

            POPL '89 Paper Acceptance Rate30of191submissions,16%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