Implementation strategies for continuations
- 1 January 1988
- conference paper
- Published by Association for Computing Machinery (ACM)
- p. 124-131
- https://doi.org/10.1145/62678.62692
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.Keywords
This publication has 11 references indexed in Scilit:
- BrouHaHa- A portable Smalltalk interpreterACM SIGPLAN Notices, 1987
- Memory allocation and higher-order functionsPublished by Association for Computing Machinery (ACM) ,1987
- Managing stack frames in SmalltalkPublished by Association for Computing Machinery (ACM) ,1987
- Revised 3 report on the algorithmic language schemeACM SIGPLAN Notices, 1986
- ORBIT: an optimizing compiler for schemePublished by Association for Computing Machinery (ACM) ,1986
- SOAR: Smalltalk without bytecodesPublished by Association for Computing Machinery (ACM) ,1986
- The implementation of PC SchemePublished by Association for Computing Machinery (ACM) ,1986
- Efficient implementation of the smalltalk-80 systemPublished by Association for Computing Machinery (ACM) ,1984
- Creating efficient systems for object-oriented languagesPublished by Association for Computing Machinery (ACM) ,1984
- Engines build process abstractionsPublished by Association for Computing Machinery (ACM) ,1984