skip to main content
10.1145/62678.62692acmconferencesArticle/Chapter ViewAbstractPublication PageslfpConference Proceedingsconference-collections
Article
Free Access

Implementation strategies for continuations

Authors Info & Claims
Published:01 January 1988Publication History

ABSTRACT

Scheme and Smalltalk continuations may have unlimited extent. This means that a purely stack-based implementation of continuations, as suffices for most languages, is inadequate. Several implementation strategies have been described in the literature. Determining which is best requires knowledge of the kinds of programs that will commonly be run.

Danvy, for example, has conjectured that continuation captures occur in clusters. That is, the same continuation, once captured, is likely to be captured again. As evidence, Danvy cited the use of continuations in a research setting. We report that Danvy's conjecture is somewhat true in the commercial setting of MacScheme+Toolsmith™, which provides tools for developing Macintosh user interfaces in Scheme. These include an interrupt-driven event system and multitasking, both implemented by liberal use of continuations.

We describe several implementation strategies for continuations and compare four of them using benchmarks. We conclude that the most popular strategy may have a slight edge when continuations are not used at all, but that other strategies perform better when continuations are used and Danvy's conjecture holds.

References

  1. Bartley 86.David H Bartley and John C Jenscn, "The Implementation of PC Scheme", Proceedings oft he 1986 ACM Conference on Lisp and Functional Programming, August 1986, pages 86-93. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Caudill 86.Patrick I Caudill and Alien Wirfs-Brock, "A Third Generation SmaUtalk-80 Implementation", Conference Proceedings of OOPSLA '86, SIGPLAN Notices 21, 11, November 1986, pages 119-130. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Danvy 87.Olivier Danvy, "Memory Allocation and Higher- Order Functions", Proceedings of the SIGPLAN '8717ymposiurn on Interpreters and Interpretive Techniques, June 1987, pages 241-252. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Deutsch 84.L Peter Deutsch and Allan M Schiffman, "Efficient Implementation of the Smalltalk-80 System", Conference Record of the llth Annual ACM Symposium on Principles of Programming Languages, January 1984, pages 297--302. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Gabriel 85.Richard P Gabriel, Performance and Evaluation of Lisp Systems, The MIT Press, 1985. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Goldberg 83.Adele Goldberg and David Robson, Smalhalk- 80: the Language and its Implementation, Addison-Wesley, 1983. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Haynes 84.Christopher T Haynes and Daniel P Friedman, "Engines Build Process Abstractions", Conference Record of the 1984 ACM Symposium on Lisp and Functional Programming, August 1984, pages 18-24. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Holloway 80.Jack Holloway, Guy L Steele, Gerald Jay Sussman, and Alan Bell, "The SCHEME-79 Chip", MIT AI Laboratory, AI Memo 559, january 1980.Google ScholarGoogle Scholar
  9. Kranz 86.David Kranz, Richard Kelsey, Jonathan Rees, Paul Hudak, James Philbin, and Norman Adams, "Orbit: An Optimizing Compiler for Scheme", Proceedingsof the SIG- PLAN '86 Symposium on Compiler Construction, July 1986, pages 219-233. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Kranz 88.David Andrew Kranz, ORBIT: An Optimizing Compiler for Scheme, PhD thesis, Yale University, May 1988.Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Miranda 87.Eliot Miranda, "BrouHaHa--A Portable Smalltalk Interpreter", Conference Proceedings of OOPSLA '87, SIGPLAN Notices 22, 12, December 1987, pages 354-365. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Moss 87.j Eliot B Moss, "Managing Stack Frames in Smalltalk", Proceedings of the SIGPLAN '87 Symposium on Interpreters and Interpretive Techniques, lune 1987, pages 229- 240. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Rees 86.Jonathan Rees and William Clinger {editors}, "Reviseda Report on the Algorithmic Language Scheme", SIG- PLAN Noticea 21, 12, December 1986, pages 37-79. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Samples 86.A Dain Samples, David Ungar, and Paul Hilfinger, "SOAR: Smalltalk without Bytecodes", Conference Proceedings of OOPSLA ' 86, SIGPLAN Notices 21, 11, November 1986, pages 107-118. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Semantic 87.Semantic Microsystems, MacScheme~Toolsmith, August 1987.Google ScholarGoogle Scholar
  16. Suzuki 84.Norihisa Suzuki and Minom Terada, "Creating Efficient Systems for Object-Oriented Languages", Conference Record of the llth Annual ACM Symposium on Principles of Programming Languages, January 1984, pages 290-296. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Ungar 87.David M Ungar, The Design and Evaluation of a High Performance Smalltalk System, The MIT Press, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Wirfs-Brock 88.Allen Wirfs-Brock, personal communication, April 1988. Tektronix Smalltalk is described in {Caudill 86, which was not detailed enough for us to realize that Tektronix Smalltalk uses the stack/heap strategy rather than the stack strategy.Google ScholarGoogle Scholar

Index Terms

  1. Implementation strategies for continuations

    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
      LFP '88: Proceedings of the 1988 ACM conference on LISP and functional programming
      January 1988
      351 pages
      ISBN:089791273X
      DOI:10.1145/62678

      Copyright © 1988 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 January 1988

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • Article

      Acceptance Rates

      Overall Acceptance Rate30of109submissions,28%

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader