Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/141471.141564acmconferencesArticle/Chapter ViewAbstractPublication PageslfpConference Proceedingsconference-collections
Article
Free access

Back to direct style II: first-class continuations

Published: 01 January 1992 Publication History
  • Get Citation Alerts
  • Abstract

    We continue to investigate the direct-style transformation by extending it to programs requiring call-with-current-continuation (a.k.a. call/cc). The direct style (DS) and the continuation-passing style (CPS) transformations form a Galois connection. This pair of functions has a place in the programmer's toolbox—yet we are not aware of the existence of any other DS transformer.
    Starting from our DS transformer towards pure, call-by-value functional terms (Scheme), we extend it with a counting analysis to detect non-canonical occurrences of a continuation. The declaration of such a continuation is translated into a call/cc and its application into the application of the corresponding first-class continuation
    We also present staged versions of the DS and of the CPS transformations, where administrative reductions are separated from the actual translation, and where the actual translations are carried out by local, structure-preserving rewriting rules. These staged transformations are used to prove the Galois continuation.
    Together, the CPS and the DS transformations enlarge the class of programs that can be manipulated on a semantic basis. We illustrate this point with partial evaluation, by specializing a Scheme program with respect to a static part of its input. The program uses coroutines. This illustration achieves a first: a static coroutine is executed statically and its computational content is inlined in the residual program.

    References

    [1]
    Rod M. Burstatl and John Darlington. A transformational system for developing recursive programs. Jou. rhal of A CM, 24(1):44-67, 1977.]]
    [2]
    William Clinger and Jonathan Rees, editors. Revised4 report on the algorithmic la.ngu~ge Scheme. LISP _Pointers, IV(3):1-55, July-September 1991.]]
    [3]
    Charles Consel. Binding time analysis for higher order untyped functional la,nguages. In LFP'90 {20}, pages 264-272.]]
    [4]
    Charles Consel. The Schism Manual. Yale University, New Haven, Connecticut, December 1990. Version 1.O.]]
    [5]
    Charles Consel and Olivier Danvy. Sta, tic and dynamic semantics processing. In POPL'91 {27}, pages 14-24.]]
    [6]
    Charles Consel and Olivier Danvy. For a better support of static data flow. In Proceedings of the Fzfth ACiIi Conference on Functional Programming and Computer Architecture, number 523 in Lecture Notes ill Computer Science, pages 496-519, Cambridge, Massachusetts, August 1991.]]
    [7]
    Ole-Johan Dahl and C.A.R. Hoare. Hierarchical program structures. In Ole-Johan Dahl, Edger Dijkstra, and C.A.R. Hoare, editors, Structured Programm,ng, pages 157-220. Academic Press, 1972.]]
    [8]
    Olivier Danvy. Three steps for the CPS transformation. TechnicM Report CIS-92-2, Kansas State University, Manhattan, Kansas, December 1991.]]
    [9]
    Olivier Danvy. Back to direct style. In Bernd Krieg- Briickner, editor, Proceedings of the Fourth ~uropean Symposium on Programming, number 582 in Lecture Notes in Computer Science, pages 130-150, Rennes, France, February 1992.]]
    [10]
    Olivier Danvy and Andrzej Filinski. Abstracting control. In LFP'90 {20}, pages 151-160.]]
    [11]
    Olivier Danvy and Andrzej Filinski. Representing control, a study of the CPS transformation. Technical Report CIS-91-2, Kansas State Univeisity, Manhattan, Kansas, January 1991.]]
    [12]
    AlaJn Deutsch. On determining lifet, nne and Miasing of dynamically allocated data in higher-older functional specifications. In POPL'90 {26}, pages 157-168.]]
    [13]
    Matthias Felleisen, Daniel P. Friedman, Eugene Kohlbecker, and Bruce Duba. A syntactic tlteory of sequentim control. Theoretical Computer Science, 52(3):205- 237, 1987.]]
    [14]
    Andrzcj Filinski. Declarative continuations: An investigation of duality in programming language semantics. In David H. Pitt et al., editors, Category Theory and Computer Science, number 389 in Lecture Notes in Computer Science, pages 224-249, Manchester, UK, September 1989.]]
    [15]
    Michael J. Fischer. Lambda calculus schemata. In Proceedings of the A C11I Conference on Proving Assertions about Program~, pages 104-109. SIGPLAN Notices, Vol. 7, No 1 and SIGACT News, No 14, January 1972.]]
    [16]
    Timothy G. Griffin. A formulae-as-types notion of control. In POPL'90 {26}, pages 47-58.]]
    [17]
    Christopher T. Haynes, Daniel P. Friedman, and Mitchell Wand. Continuations and coroutines. In Conference Record of the 198d A CM Symposium o~ Lisp and Functional Programming, pages 293-298, Austin, Texas, August 1984.]]
    [18]
    Robert Hieb and R. Kent Dybvig. Continuations and concurrency, in Proceedings of the Second A CM SIC- PLAN Symposium on Principles fJ Practice of Parallel, Programming, pages 128-136, Sca.tt,le, WaMlington, March 1990. SIGPLAN Notices, Vol. 25, No. 3.]]
    [19]
    Pierre Jouvelot and David K. Gifford. Reasoning about continuations with control effects. In Proceedings of the A CAI SIGPLAN'89 Conference on Programm~r~g La~guagcs Design, and Implementation, pages 218-226, Portland, Oregon, June 1989.]]
    [20]
    Proceedir~gs of the 1990 A Clll Conference on Lisp and Functional Progrommzng, Nice, France, June 1990.]]
    [21]
    Austin Melton, David A. Schmidt, and George Strecker. Galois connections and computer science applications. In David H. Pitt et al., editors, Category Theory and Computer Programming, number 240 in Lecture Notes in Computer Science, pages 299-312, Guildford, UK, September 1986.]]
    [22]
    Eugenio Moggi. Computational lambda-calculus and monads. In Proceedings of the Fourth Annual Symposium on Locjlc 2n Computer Sczeace. pages 14-23, Pacific Grove, California, June 1989. IEEE.]]
    [23]
    Cheta.n R. Murthy. An evaluation semantics for classical proofs. In Proceedings of the Sixth Sy.mposium on Logic in Computer Sczer~ce, Amsterdam, The Netherlands, July 1991. IEEE.]]
    [24]
    Flemming Nielson. A denotationM f~amewmk for data flow analysis. Acta fr~formatica, 18:265-287, 1982.]]
    [25]
    Gordon D. Plotkin. Call-by-name, call-by-value and the A-calculus. Theoretical Computer Science, 1:125-159, 1975.]]
    [26]
    Proceedings of the Seventeenth Annual A CM Symposzum on Principles of Programming Languages, San Francisco, California, January 1990. ACM Pless.]]
    [27]
    ?rocced~,n, gs of the Eighteenth Annual A CM Symposium ca Principles of Programmir, g Languages, Orlando, Florida, January 1991. ACM Press.]]
    [28]
    Christian Queinnec and Bernard Serpette. A dynamic extent control operator for partial continuations. In POPL'91 {27}, pages 174-184.]]
    [29]
    John C. Reynolds. Definitional interpreters for higherorder programming languages. In Proceedings o.f 25th A CM Not~onal Cor~ference, pages 717-740, Boston, 1972.]]
    [30]
    Amr Sabry and Matthias Felleisen. Reasoning about proglams in continuation-passing style. In Proceeding~ of the I99o A C3{ Con. fcrel~ce on L~sp ctlzd Functional Programnti~g, Sail Francisco, California, June 1992.]]
    [31]
    Guy L. Steele Jr. Rabbit: A compiler for Scheme. Technical Report AI-TR-474, Artificial Intelligence Laboratory, Massachusetts Institute of Technology, Cambridge, Massachusetts, May 1978.]]
    [32]
    Carolyn L. Ta,lcott. The Essence of T~um: A Theory of the Inter~s,onol and Extensional Aspects of L~sp-type Computation. PhD thesis, Department of Computer Science, Stanford University, Stanford, California, August 1985.]]
    [33]
    Philip Wadler. The essence of functional plogramming. In Proceeding~ of the Nineteenth Annual A CM Symposium on Pr~'nc~ptes of Programming Languages, pages 1-14, Albuquelque, New Mexico, January 1992. ACM Press.]]

    Cited By

    View all
    • (2023)Back to Direct Style: Typed and TightProceedings of the ACM on Programming Languages10.1145/35860567:OOPSLA1(848-875)Online publication date: 6-Apr-2023
    • (2023)Towards a Reflection for Effect HandlersProceedings of the 2023 ACM SIGPLAN International Workshop on Partial Evaluation and Program Manipulation10.1145/3571786.3573015(55-65)Online publication date: 15-Jan-2023
    • (2020)From folklore to fact: comparing implementations of stacks and continuationsProceedings of the 41st ACM SIGPLAN Conference on Programming Language Design and Implementation10.1145/3385412.3385994(75-90)Online publication date: 11-Jun-2020
    • Show More Cited By

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    LFP '92: Proceedings of the 1992 ACM conference on LISP and functional programming
    January 1992
    365 pages
    ISBN:0897914813
    DOI:10.1145/141471
    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]

    Sponsors

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 01 January 1992

    Permissions

    Request permissions for this article.

    Check for updates

    Qualifiers

    • Article

    Conference

    LFP92
    LFP92: ACM Conference on Lisp and Functional Programming
    June 22 - 24, 1992
    California, San Francisco, USA

    Acceptance Rates

    Overall Acceptance Rate 30 of 109 submissions, 28%

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)57
    • Downloads (Last 6 weeks)9
    Reflects downloads up to 10 Aug 2024

    Other Metrics

    Citations

    Cited By

    View all
    • (2023)Back to Direct Style: Typed and TightProceedings of the ACM on Programming Languages10.1145/35860567:OOPSLA1(848-875)Online publication date: 6-Apr-2023
    • (2023)Towards a Reflection for Effect HandlersProceedings of the 2023 ACM SIGPLAN International Workshop on Partial Evaluation and Program Manipulation10.1145/3571786.3573015(55-65)Online publication date: 15-Jan-2023
    • (2020)From folklore to fact: comparing implementations of stacks and continuationsProceedings of the 41st ACM SIGPLAN Conference on Programming Language Design and Implementation10.1145/3385412.3385994(75-90)Online publication date: 11-Jun-2020
    • (2018)Refunctionalization of abstract abstract machines: bridging the gap between abstract abstract machines and abstract definitional interpreters (functional pearl)Proceedings of the ACM on Programming Languages10.1145/32368002:ICFP(1-28)Online publication date: 30-Jul-2018
    • (2015)A Dynamic Continuation-Passing Style for Dynamic Delimited ContinuationsACM Transactions on Programming Languages and Systems10.1145/279407838:1(1-25)Online publication date: 16-Oct-2015
    • (2010)CPS-translation as adjointTheoretical Computer Science10.1016/j.tcs.2009.06.033411:2(324-340)Online publication date: 1-Jan-2010
    • (2010)Defunctionalized interpreters for call-by-need evaluationProceedings of the 10th international conference on Functional and Logic Programming10.1007/978-3-642-12251-4_18(240-256)Online publication date: 19-Apr-2010
    • (2009)Refunctionalization at workScience of Computer Programming10.1016/j.scico.2007.10.00774:8(534-549)Online publication date: 1-Jun-2009
    • (2009)From Reduction-Based to Reduction-Free NormalizationAdvanced Functional Programming10.1007/978-3-642-04652-0_3(66-164)Online publication date: 2009
    • (2008)From reduction-based to reduction-free normalizationProceedings of the 6th international conference on Advanced functional programming10.5555/1813347.1813350(66-164)Online publication date: 19-May-2008
    • Show More Cited By

    View Options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Get Access

    Login options

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media