ABSTRACT
Operators for delimiting control and for capturing composable continuations litter the landscape of theoretical programming language research. Numerous papers explain their advantages, how the operators explain each other (or don't), and other aspects of the operators' existence. Production programming languages, however, do not support these operators, partly because their relationship to existing and demonstrably useful constructs - such as exceptions and dynamic binding - remains relatively unexplored.
In this paper, we report on our effort of translating the theory of delimited and composable control into a viable implementation for a production system. The report shows how this effort involved a substantial design element, including work with a formal model, as well as significant practical exploration and engineering.
The resulting version of PLT Scheme incorporates the expressive combination of delimited and composable control alongside dynamic-wind, dynamic binding, and exception handling. None of the additional operators subvert the intended benefits of existing control operators, so that programmers can freely mix and match control operators.
- Dariusz Biernacki, Olivier Danvy, and Chung-chieh Shan. On the static and dynamic extents of delimited continuations. Science of Computer Programming, 60 (3): 274--297, 2006. Google Scholar
Digital Library
- John Clements and Matthias Felleisen. A tail-recursive machine with stack inspection. ACM Transactions on Computing Systems, 26 (6): 1029--1052, 2004. Google Scholar
Digital Library
- John Clements, Matthew Flatt, and Matthias Felleisen. Modeling an algebraic stepper. In Proc. European Symposium on Programming, number 2028 in Lecture Notes in Computer Science, pages 320--334, April 2001. Google Scholar
Digital Library
- Olivier Danvy and Andrzej Filinski. Abstracting control. In Proc. ACM Conference on Lisp and Functional Programming, pages 151--160, 1990. Google Scholar
Digital Library
- R. Kent Dybvig, Simon Peyton Jones, and Amr Sabry. A monadic framework for delimited continuations. Journal of Functional Programming, 2006. To appear.Google Scholar
- Matthias Felleisen. The theory and practice of first-class prompts. In Proc. ACM Symposium on Principles of Programming Languages, pages 180--190, 1988. Google Scholar
Digital Library
- Matthias Felleisen. On the expressive power of programming languages. Science of Compututer Programming, 17 (1-3): 35--75, 1991. Google Scholar
Digital Library
- Andrzej Filinski. Representing monads. In Proc. ACM Symposium on Principles of Programming Languages, pages 446--457, 1994. Google Scholar
Digital Library
- Robert Bruce Findler, John Clements, Cormac Flanagan, Matthew Flatt, Shriram Krishnamurthi, Paul Steckler, and Matthias Felleisen. DrScheme: A programming environment for Scheme. Journal of Functional Programming, 12 (2): 159--182, March 2002. Google Scholar
Digital Library
- Matthew Flatt. PLT MzScheme: Language manual. Technical Report PLT-TR2007-1-v370, PLT Scheme, 2007.Google Scholar
- Daniel P. Friedman and Christopher T. Haynes. Constraining control. In Proc. ACM Symposium on Principles of Programming Languages, pages 245--254, January 1985. Google Scholar
Digital Library
- Martin Gasbichler and Michael Sperber.Final shift for call/cc: a direct implementation of shift and reset.In Proc. ACM International Conference on Functional Programming, pages 271--282, 2002. Google Scholar
Digital Library
- Martin Gasbichler, Eric Knauel, Michael Sperber, and Richard A. Kelsey. How to add threads to a sequential language without getting tangled up. In Proc. Workshop on Scheme and Functional Programming, 2003.Google Scholar
- Carl Gunter, Didier R&3233;my, and Jon Riecke. A generalization of exceptions and control in ML-like languages. In Proc. ACM Conference on Functional Programming and Computer Architecture, pages 12--23, 1995. Google Scholar
Digital Library
- David Herman, Aaron Tomb, and Cormac Flanagan. Space-efficient gradual typing. In Proc. Trends in Functional Programming, 2007.Google Scholar
- Robert Hieb and R. Kent Dybvig. Continuations and concurrency. In Proc. ACM Symposium on Principles and Practice of Parallel Programming, pages 128--136, 1990. Google Scholar
Digital Library
- Robert Hieb, Kent Dybvig, and Claude W. Anderson, III. Subcontinuations. Lisp and Symbolic Computation, 7 (1): 83--110, 1994. Google Scholar
Digital Library
- Richard Kelsey, William Clinger, and J. Rees (Eds.). The revised5 report on the algorithmic language Scheme. ACM SIGPLAN Notices, 33 (9), September 1998. Google Scholar
Digital Library
- Richard A. Kelsey and Jonathan Rees. Scheme48, 2007. http://s48.org/Google Scholar
- Oleg Kiselyov. How to remove a dynamic prompt: static and dynamic delimited continuation operators are equally expressible. Technical Report TR611, Indiana University Computer Science, 2005a.Google Scholar
- Oleg Kiselyov. Generic implementation of all four *F* operators: from control0 to shift, 2005. http://okmij.org/ftp/Computation/Continuations.html#generic-control.Google Scholar
- Oleg Kiselyov, Chung-chieh Shan, and Amr Sabry. Delimited dynamic binding. In Proc. ACM International Conference on Functional Programming, pages 26--37, 2006. Google Scholar
Digital Library
- Shriram Krishnamurthi, Peter Walton Hopkins, Jay McCarthy, Paul T. Graunke, Greg Pettyjohn, and Matthias Felleisen. Implementation and use of the PLT Scheme web server. Higher-Order and Symbolic Computation, 2007. To appear. Google Scholar
Digital Library
- James Laird. Exceptions, continuations and macro-expressiveness. In Proc. European Symposium on Programming, pages 133--146, 2002. Google Scholar
Digital Library
- Jacob Matthews, Robert Bruce Findler, Matthew Flatt, and Matthias Felleisen. A visual environment for developing context-sensitive term rewriting systems. In Proc. International Conference on Rewriting Techniques and Applications, volume 3091 of Lecture Notes in Computer Science, 2004.Google Scholar
Cross Ref
- Christian Queinnec and Bernard P. Serpette. A dynamic extent control operator for partial continuations. In Proc. ACM Symposium on Principles of Programming Languages, pages 174--184, 1991. Google Scholar
Digital Library
- Jon G. Riecke and Hayo Thielecke. Typed exceptions and continuations cannot macro-express each other. In Proc. International Colloquium on Automata, Languages and Programming, pages 635--644, 1999. Google Scholar
Digital Library
- Chung-chieh Shan. Shift to control. In Proc. Workshop on Scheme and Functional Programming, pages 99--107, 2004.Google Scholar
- Dorai Sitaram. Handling control. In Proc. ACM Conference on Programming Language Design and Implementation, pages 147--155, 1993. Google Scholar
Digital Library
- Dorai Sitaram and Matthias Felleisen. Control delimiters and their hierarchies. Lisp and Symbolic Computation, 3 (1): 67--99, 1990. Google Scholar
Digital Library
- Michael Sperber (Ed.). The revised5.97 report on the algorithmic language Scheme, 2007.Google Scholar
- Hayo Thielecke. On exceptions versus continuations in the presence of state. In Proc. European Symposium on Programming, pages 397--411, 2000. Google Scholar
Digital Library
Index Terms
Adding delimited and composable control to a production programming environment
Recommendations
Adding delimited and composable control to a production programming environment
Proceedings of the ICFP '07 conferenceOperators for delimiting control and for capturing composable continuations litter the landscape of theoretical programming language research. Numerous papers explain their advantages, how the operators explain each other (or don't), and other aspects ...
Delimited control in OCaml, abstractly and concretely
We describe the first implementation of multi-prompt delimited control operators in OCaml that is direct in that it captures only the needed part of the control stack. The implementation is a library that requires no changes to the OCaml compiler or run-...
Composable and compilable macros:: you want it when?
Many macro systems, especially for Lisp and Scheme, allow macro transformers to perform general computation. Moreover, the language for implementing compile-time macro transformers is usually the same as the language for implementing run-time functions. ...







Comments