Affiliation:
1. Systems Research Center, Compaq
2. Indiana University
3. Seattle University
4. Northeastern University
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.
Publisher
Association for Computing Machinery (ACM)
Subject
Computer Graphics and Computer-Aided Design,Software
Cited by
5 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Multi-Stage Vertex-Centric Programming for Agent-Based Simulations;Proceedings of the 22nd ACM SIGPLAN International Conference on Generative Programming: Concepts and Experiences;2023-10-22
2. Memoized Flat Closures for CPS;Lecture Notes in Computer Science;2018
3. MELT - a Translated Domain Specific Language Embedded in the GCC Compiler;Electronic Proceedings in Theoretical Computer Science;2011-09-01
4. The two-state solution;ACM SIGPLAN Notices;2010-10-17
5. Automatically RESTful web applications;ACM SIGPLAN Notices;2009-08-31