skip to main content
article

Adding delimited and composable control to a production programming environment

Published: 01 October 2007 Publication History

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.

References

[1]
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.
[2]
John Clements and Matthias Felleisen. A tail-recursive machine with stack inspection. ACM Transactions on Computing Systems, 26 (6): 1029--1052, 2004.
[3]
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.
[4]
Olivier Danvy and Andrzej Filinski. Abstracting control. In Proc. ACM Conference on Lisp and Functional Programming, pages 151--160, 1990.
[5]
R. Kent Dybvig, Simon Peyton Jones, and Amr Sabry. A monadic framework for delimited continuations. Journal of Functional Programming, 2006. To appear.
[6]
Matthias Felleisen. The theory and practice of first-class prompts. In Proc. ACM Symposium on Principles of Programming Languages, pages 180--190, 1988.
[7]
Matthias Felleisen. On the expressive power of programming languages. Science of Compututer Programming, 17 (1-3): 35--75, 1991.
[8]
Andrzej Filinski. Representing monads. In Proc. ACM Symposium on Principles of Programming Languages, pages 446--457, 1994.
[9]
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.
[10]
Matthew Flatt. PLT MzScheme: Language manual. Technical Report PLT-TR2007-1-v370, PLT Scheme, 2007.
[11]
Daniel P. Friedman and Christopher T. Haynes. Constraining control. In Proc. ACM Symposium on Principles of Programming Languages, pages 245--254, January 1985.
[12]
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.
[13]
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.
[14]
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.
[15]
David Herman, Aaron Tomb, and Cormac Flanagan. Space-efficient gradual typing. In Proc. Trends in Functional Programming, 2007.
[16]
Robert Hieb and R. Kent Dybvig. Continuations and concurrency. In Proc. ACM Symposium on Principles and Practice of Parallel Programming, pages 128--136, 1990.
[17]
Robert Hieb, Kent Dybvig, and Claude W. Anderson, III. Subcontinuations. Lisp and Symbolic Computation, 7 (1): 83--110, 1994.
[18]
Richard Kelsey, William Clinger, and J. Rees (Eds.). The revised5 report on the algorithmic language Scheme. ACM SIGPLAN Notices, 33 (9), September 1998.
[19]
Richard A. Kelsey and Jonathan Rees. Scheme48, 2007. http://s48.org/
[20]
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.
[21]
Oleg Kiselyov. Generic implementation of all four *F* operators: from control0 to shift, 2005. http://okmij.org/ftp/Computation/Continuations.html#generic-control.
[22]
Oleg Kiselyov, Chung-chieh Shan, and Amr Sabry. Delimited dynamic binding. In Proc. ACM International Conference on Functional Programming, pages 26--37, 2006.
[23]
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.
[24]
James Laird. Exceptions, continuations and macro-expressiveness. In Proc. European Symposium on Programming, pages 133--146, 2002.
[25]
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.
[26]
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.
[27]
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.
[28]
Chung-chieh Shan. Shift to control. In Proc. Workshop on Scheme and Functional Programming, pages 99--107, 2004.
[29]
Dorai Sitaram. Handling control. In Proc. ACM Conference on Programming Language Design and Implementation, pages 147--155, 1993.
[30]
Dorai Sitaram and Matthias Felleisen. Control delimiters and their hierarchies. Lisp and Symbolic Computation, 3 (1): 67--99, 1990.
[31]
Michael Sperber (Ed.). The revised5.97 report on the algorithmic language Scheme, 2007.
[32]
Hayo Thielecke. On exceptions versus continuations in the presence of state. In Proc. European Symposium on Programming, pages 397--411, 2000.

Cited By

View all

Index Terms

  1. Adding delimited and composable control to a production programming environment

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM SIGPLAN Notices
    ACM SIGPLAN Notices  Volume 42, Issue 9
    Proceedings of the ICFP '07 conference
    September 2007
    331 pages
    ISSN:0362-1340
    EISSN:1558-1160
    DOI:10.1145/1291220
    Issue’s Table of Contents
    • cover image ACM Conferences
      ICFP '07: Proceedings of the 12th ACM SIGPLAN international conference on Functional programming
      October 2007
      346 pages
      ISBN:9781595938152
      DOI:10.1145/1291151
    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: 01 October 2007
    Published in SIGPLAN Volume 42, Issue 9

    Check for updates

    Qualifiers

    • Article

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)15
    • Downloads (Last 6 weeks)5
    Reflects downloads up to 07 Nov 2024

    Other Metrics

    Citations

    Cited By

    View all
    • (2024)Continuations: What Have They Ever Done for Us? (Experience Report)Proceedings of the 2nd ACM SIGPLAN International Workshop on Functional Software Architecture10.1145/3677998.3678223(25-30)Online publication date: 28-Aug-2024
    • (2023)A Type System for Effect Handlers and Dynamic LabelsProgramming Languages and Systems10.1007/978-3-031-30044-8_9(225-252)Online publication date: 22-Apr-2023
    • (2016)From Events to Reactions: A Progress ReportElectronic Proceedings in Theoretical Computer Science10.4204/EPTCS.211.5211(46-55)Online publication date: 17-Jun-2016
    • (2016)Dependence-driven delimited CPS transformation for JavaScriptACM SIGPLAN Notices10.1145/3093335.299324352:3(59-69)Online publication date: 20-Oct-2016
    • (2016)Dependence-driven delimited CPS transformation for JavaScriptProceedings of the 2016 ACM SIGPLAN International Conference on Generative Programming: Concepts and Experiences10.1145/2993236.2993243(59-69)Online publication date: 20-Oct-2016
    • (2016)Proceedings of the 2016 ACM SIGPLAN International Conference on Generative Programming: Concepts and ExperiencesundefinedOnline publication date: 20-Oct-2016
    • (2013)Constraining delimited control with contractsProceedings of the 22nd European conference on Programming Languages and Systems10.1007/978-3-642-37036-6_14(229-248)Online publication date: 16-Mar-2013
    • (2024)Stack-Copying Delimited Continuations for Scala NativeProceedings of the 19th ACM International Workshop on Implementation, Compilation, Optimization of OO Languages, Programs and Systems10.1145/3679005.3685979(2-13)Online publication date: 13-Sep-2024
    • (2024)Effectful Software ContractsProceedings of the ACM on Programming Languages10.1145/36329308:POPL(2639-2666)Online publication date: 5-Jan-2024
    • (2023)Typed Equivalence of Labeled Effect Handlers and Labeled Delimited Control OperatorsProceedings of the 25th International Symposium on Principles and Practice of Declarative Programming10.1145/3610612.3610616(1-13)Online publication date: 22-Oct-2023
    • Show More Cited By

    View Options

    Get Access

    Login options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media