ACM Home Page
Please provide us with feedback. Feedback
The essence of compiling with continuations
Full text PdfPdf (1.72 MB)
Source ACM SIGPLAN Notices archive
Volume 39 ,  Issue 4  (April 2004) table of contents
Best of PLDI 1979-1999
SPECIAL ISSUE: 1993 table of contents
Pages: 502 - 514  
Year of Publication: 2004
ISSN:0362-1340
Authors
Cormac Flanagan  Systems Research Center, Compaq
Amr Sabry  Indiana University
Bruce F. Duba  Seattle University
Matthias Felleisen  Northeastern University
Publisher
ACM  New York, NY, USA
Bibliometrics
Downloads (6 Weeks): 11,   Downloads (12 Months): 56,   Citation Count: 1
Additional Information:

abstract   references   cited by   collaborative colleagues  

Tools and Actions: Review this Article  
DOI Bookmark: Use this link to bookmark this Article: http://doi.acm.org/10.1145/989393.989443
What is a DOI?

ABSTRACT

In order to simplify the compilation process, many compilers for higher-order languages use the continuation-passing style (CPS) transformation in a first phase to generate an intermediate representation of the source program. The salient aspect of this intermediate form is that all procedures take an argument that represents the rest of the computation (the "continuation"). Since the naïve CPS transformation considerably increases the size of programs, CPS compilers perform reductions to produce a more compact intermediate representation. Although often implemented as a part of the CPS transformation, this step is conceptually a second phase. Finally, code generators for typical CPS compilers treat continuations specially in order to optimize the interpretation of continuation parameters.A thorough analysis of the abstract machine for CPS terms shows that the actions of the code generator invert the naïve CPS translation step. Put differently, the combined effect of the three phases is equivalent to a source-to-source transformation that simulates the compaction phase. Thus, fully developed CPS compilers do not need to employ the CPS transformation but can achieve the same results with a simple source-level transformation.


REFERENCES

Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.

 
1
2
 
3
Andrew W. Appel and David B. MacQueen. Standard ML of New Jersey. In J. Maluszyński and M. Wirsing, editors, Proceedings of the 3rd Int. Symposium on Programming Language Implementation and Logic Programming, PLILP91, Passau, Germany, Lecture Notes in Computer Science, pages 1--13. Springer-Verlag, August 1991.
 
4
Andrew W. Appel and David B. MacQueen. Standard ML of New Jersey. Technical Report TR-329-91, Princeton University, Computer Science Department, June 1991.
5
 
6
M. Felleisen and D. P. Friedman. Control operators, the SECD-machine, and the λ-calculus, pages 193--217. North-Holland, 1986.
7
 
8
Matthias Felleisen, Daniel P. Friedman, Eugene Kohlbecker, and Bruce Duba. Reasoning with continuations. In Proc. of 1st Ann. IEEE Symp. on Logic in Computer Science, LICS'86, Cambridge, MA, USA, 16--18 June 1986, pages 131--141. IEEE Computer Society Press, Washington, DC, 1986.
 
9
10
 
11
12
13
 
14
Xavier Leroy. A syntactic theory of type generativity and sharing. Journal of Functional Programming, 6(5):667--698, September 1996.
 
15
G. Plotkin. Call-by-name, call-by-value, and the λ-calculus. Theoretical Computer Science, 1(2):125--159, 1975.
 
16
John Reppy. Local CPS conversion in a direct-style compiler. In Proceedings of the Third ACM SIGPLAN Workshop on Continuations (CW'01), pages 13--22, January 2001.
17
 
18
19
 
20
21
 
22
 
23
 
24
BARENDREGT, H. The Lambda Calculus: Its Syntax and Semantics, revised ed. Studies in Logic and the Foundations of Mathematics 103. North-Holland, 1984.
25
26
27
 
28
 
29
DANVY, O. Three steps for the CPS transformation. Tech. Rep. CIS-92-2, Kansas State University, 1992.
 
30
DANVY, O., AND FILINSKI, A. Representing control: A study of the CPS transformation. Mathematical Structures in Computer Science, 4 (1992), 361--391.
 
31
FELLEISEN, M., AND FRIEDMAN, D. Control operators, the SECD-machine, and the λ-calculus. In Formal Description of Programming Concepts III (Amsterdam, 1986), M. Wirsing, Ed., Elsevier Science Publishers B.V. (North-Holland), pp. 193--217.
 
32
FESSENDEN, C., CLINGER, W., FRIEDMAN, D. P., AND HAYNES, C. T. Scheme 311 version 4 reference manual. Computer Science Technical Report 137, Indiana University, Bloomington, Indiana, Feb. 1983.
33
34
35
 
36
LEROY, X. The Zinc experiment: An economical implementation of the ML language. Tech. Rep. 117, INRIA, 1990.
 
37
PLOTKIN, G. Call-by-name, call-by-value, and the λ-calculus. Theoretical Computer Science 1 (1975), 125--159.
38
 
39
 
40
STEELE, G. L. RABBIT: A compiler for Scheme. MIT AI Memo 474, Massachusetts Institute of Technology, Cambridge, Mass., May 1978.
 
41
 
42
WEISE, D. Advanced compiling techniques. Course Notes at Stanford University, 1990.

Collaborative Colleagues:
Cormac Flanagan: colleagues
Amr Sabry: colleagues
Bruce F. Duba: colleagues
Matthias Felleisen: colleagues