Skip to main content

Cutting Out Continuations

  • Chapter
  • First Online:
A List of Successes That Can Change the World

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 9600))

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

References

  1. 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)

    Google Scholar 

  2. 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)

    Google Scholar 

  3. 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)

    Article  MathSciNet  MATH  Google Scholar 

  4. Backhouse, R.: Program Construction: Calculating Implementations from Specifications. Wiley, New York (2003)

    Google Scholar 

  5. Bahr, P., Hutton, G.: Calculating correct compilers. J. Funct. Program. 25, 47 (2015)

    Article  MathSciNet  Google Scholar 

  6. 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)

    Google Scholar 

  7. Hutton, G., Bahr, P.: Associated Coq proofs. http://github.com/pa-ba/cps-defun

  8. Hutton, G., Wright, J.: Calculating an exceptional machine. In: Loidl, H.W. (ed.) Trends in Functional Programming. Intellect, February 2006

    Google Scholar 

  9. Krivine, J.L.: Un Interpréteur du Lambda-calcul (1985). Unpublished manuscript

    Google Scholar 

  10. Landin, P.J.: The mechanical evaluation of expressions. Comput. J. 6(4), 308–320 (1964)

    Article  MATH  Google Scholar 

  11. Meijer, E.: Calculating compilers. Ph.D. thesis, Katholieke Universiteit Nijmegen (1992)

    Google Scholar 

  12. Reynolds, J.C.: Definitional interpreters for higher-order programming languages. In: Proceedings of the ACM Annual Conference, pp. 717–740 (1972)

    Google Scholar 

  13. Wand, M.: Deriving target code as a representation of continuation semantics. ACM Trans. Program. Lang. Syst. 4(3), 496–517 (1982)

    Article  MATH  Google Scholar 

  14. Winskel, G.: The Formal Semantics of Programming Languages - An Introduction. Foundation of Computing Series. MIT Press, Cambridge (1993)

    MATH  Google Scholar 

Download references

Acknowledgements

We thank the anonymous reviewers for their comments and suggestions.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Graham Hutton .

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics