Back to direct style II
- 1 January 1992
- journal article
- Published by Association for Computing Machinery (ACM) in ACM SIGPLAN Lisp Pointers
- Vol. V (1) , 299-310
- https://doi.org/10.1145/141478.141564
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.This publication has 21 references indexed in Scilit:
- Declarative continuations: An investigation of duality in programming language semanticsPublished by Springer Nature ,2005
- Revised 4 report on the algorithmic language schemeACM SIGPLAN Lisp Pointers, 1991
- Continuations and concurrencyACM SIGPLAN Notices, 1990
- A syntactic theory of sequential controlTheoretical Computer Science, 1987
- Galois connections and computer science applicationsPublished by Springer Nature ,1986
- A denotational framework for data flow analysisActa Informatica, 1982
- A Transformation System for Developing Recursive ProgramsJournal of the ACM, 1977
- Call-by-name, call-by-value and the λ-calculusTheoretical Computer Science, 1975
- Lambda calculus schemataPublished by Association for Computing Machinery (ACM) ,1972
- Definitional interpreters for higher-order programming languagesPublished by Association for Computing Machinery (ACM) ,1972