Author:
Danvy Oliver,Filinski Andrzex
Abstract
This paper investigates the transformation of λν-terms into continuation-passing style (CPS). We show that by appropriate η-expansion of Fisher and Plotkin's two-pass equational specification of the CPS transform, we can obtain a static and context-free separation of the result terms into “essential” and “administrative” constructs. Interpreting the former as syntax builders and the latter as directly executable code, We obtain a simple and efficient one-pass transformation algorithm, easily extended to conditional expressions, recursive definitions, and similar constructs. This new transformation algorithm leads to a simpler proof of Plotkin's simulation and indifference results.We go on to show how CPS-based control operators similar to, more general then, Scheme's call/cc can be naturally accommodated by the new transformation algorithm. To demonstrate the expressive power of these operators, we use them to present an equivalent but even more concise formulation of the efficient CPS transformation algorithm. Finally, we relate the fundamental ideas underlying this derivation to similar concepts from other work on program manipulation; we derive a one-pass CPS transformation of λn-terms; and we outline some promising areas for future research.
Publisher
Cambridge University Press (CUP)
Subject
Computer Science Applications,Mathematics (miscellaneous)
Cited by
159 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Compiling Probabilistic Programs for Variable Elimination with Information Flow;Proceedings of the ACM on Programming Languages;2024-06-20
2. Generating Well-Typed Terms That Are Not “Useless”;Proceedings of the ACM on Programming Languages;2024-01-05
3. From Capabilities to Regions: Enabling Efficient Compilation of Lexical Effect Handlers;Proceedings of the ACM on Programming Languages;2023-10-16
4. Parameterized Algebraic Protocols;Proceedings of the ACM on Programming Languages;2023-06-06
5. Analyzing binding extent in 3CPS;Proceedings of the ACM on Programming Languages;2022-08-29