Implementation Strategies for First-Class Continuations

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. We review several implementation strategies for continuations and compare their performance using instruction counts for the normal case and continuation-intensive synthetic benchmarks for other scenarios, including coroutines and multitasking. All of the strategies constrain a compiler in some way, resulting in indirect costs that are hard to measure directly. We use related measurements on a set of benchmarks to calculate upper bounds for these indirect costs.

O. Danvy, Memory allocation and higher-order functions. In Proceedings of the SIGPLAN '87 Symposium on Interpreters and Interpretive Techniques, June 1987, 241–252.Google Scholar

19.

L.P. Deutsch and A.M. Schiffman, Efficient implementation of the Smalltalk-80 system. In Conference Record of the 11th Annual ACM Symposium on Principles of Programming Languages, January 1984, 297–302.Google Scholar

A. Wirfs-Brock, Personal communication, April 1988. Tektronix Smalltalk was described by Caudill and Wirfs-brock, but not in enough detail for us to realize that Tektronix Smalltalk uses the stack/heap strategy rather than the stack strategy [10].Google Scholar