Abstract
In the field of program transformation, one often transforms programs into continuation-passing style to make their flow of control explicit, and then immediately removes the resulting continuations using defunctionalisation to make the programs first-order. In this article, we show how these two transformations can be fused together into a single transformation step that cuts out the need to first introduce and then eliminate continuations. Our approach is calculational, uses standard equational reasoning techniques, and is widely applicable.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
Ager, M.S., Biernacki, D., Danvy, O., Midtgaard, J.: A functional correspondence between evaluators and abstract machines. In: Proceedings of the 5th ACM SIGPLAN International Conference on Principles and Practice of Declaritive Programming (2003)
Ager, M.S., Biernacki, D., Danvy, O., Midtgaard, J.: From interpreter to compiler and virtual machine: a functional derivation. Technical report RS-03-14, BRICS, Department of Computer Science, University of Aarhus (2003)
Ager, M.S., Danvy, O., Midtgaard, J.: A functional correspondence between call-by-need evaluators and lazy abstract machines. Inf. Process. Lett. 90(5), 223–232 (2004)
Backhouse, R.: Program Construction: Calculating Implementations from Specifications. Wiley, New York (2003)
Bahr, P., Hutton, G.: Calculating correct compilers. J. Funct. Program. 25, 47 (2015)
Felleisen, M., Friedman, D.P.: Control operators, the SECD machine, and the \(\lambda \)-calculus. In: Wirsing, M. (ed.) Formal Description of Programming Concepts III, pp. 193–217. Elsevier Science Publishers B.V., Amsterdam (1986)
Hutton, G., Bahr, P.: Associated Coq proofs. http://github.com/pa-ba/cps-defun
Hutton, G., Wright, J.: Calculating an exceptional machine. In: Loidl, H.W. (ed.) Trends in Functional Programming. Intellect, February 2006
Krivine, J.L.: Un Interpréteur du Lambda-calcul (1985). Unpublished manuscript
Landin, P.J.: The mechanical evaluation of expressions. Comput. J. 6(4), 308–320 (1964)
Meijer, E.: Calculating compilers. Ph.D. thesis, Katholieke Universiteit Nijmegen (1992)
Reynolds, J.C.: Definitional interpreters for higher-order programming languages. In: Proceedings of the ACM Annual Conference, pp. 717–740 (1972)
Wand, M.: Deriving target code as a representation of continuation semantics. ACM Trans. Program. Lang. Syst. 4(3), 496–517 (1982)
Winskel, G.: The Formal Semantics of Programming Languages - An Introduction. Foundation of Computing Series. MIT Press, Cambridge (1993)
Acknowledgements
We thank the anonymous reviewers for their comments and suggestions.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2016 Springer International Publishing Switzerland
About this chapter
Cite this chapter
Hutton, G., Bahr, P. (2016). Cutting Out Continuations. In: Lindley, S., McBride, C., Trinder, P., Sannella, D. (eds) A List of Successes That Can Change the World. Lecture Notes in Computer Science(), vol 9600. Springer, Cham. https://doi.org/10.1007/978-3-319-30936-1_10
Download citation
DOI: https://doi.org/10.1007/978-3-319-30936-1_10
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-30935-4
Online ISBN: 978-3-319-30936-1
eBook Packages: Computer ScienceComputer Science (R0)