Skip to main content

Evaluating Call-by-Need on the Control Stack

  • Conference paper
Trends in Functional Programming (TFP 2010)

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

Included in the following conference series:

  • 474 Accesses

Abstract

Ariola and Felleisen’s call-by-need λ-calculus replaces a variable occurrence with its value at the last possible moment. To support this gradual notion of substitution, function applications—once established—are never discharged. In this paper we show how to translate this notion of reduction into an abstract machine that resolves variable references via the control stack. In particular, the machine uses the static address of a variable occurrence to extract its current value from the dynamic control stack.

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

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Similar content being viewed by others

References

  1. Plotkin, G.D.: Call-by-name, call-by-value and the λ-calculus. Theoretical Computer Science 1, 125–159 (1975)

    Article  MathSciNet  MATH  Google Scholar 

  2. Ariola, Z.M., Felleisen, M.: The call-by-need lambda calculus. Journal of Functional Programming 7, 265–301 (1997)

    Article  MathSciNet  MATH  Google Scholar 

  3. Garcia, R., Lumsdaine, A., Sabry, A.: Lazy evaluation and delimited control. In: Proceedings of the 36th Annual Symposium on Principles of Programming Languages, pp. 153–164. ACM, New York (2009)

    Google Scholar 

  4. Barendregt, H.P.: The Lambda Calculus: Its Syntax and Semantics. North Holland, Amsterdam (1981)

    MATH  Google Scholar 

  5. De Bruijn, N.G.: Lambda calculus notation with nameless dummies, a tool for automatic formula manipulation, with application to the Church-Rosser theorem. Indagationes Mathematicae, 381–392 (1972)

    Google Scholar 

  6. Felleisen, M., Findler, R.B., Flatt, M.: Semantics Engineering with PLT Redex. MIT Press, Cambridge (2009)

    MATH  Google Scholar 

  7. Ariola, Z.M., Felleisen, M., Maraist, J., Odersky, M., Wadler, P.: The call-by-need lambda calculus. In: Proceedings of the 22nd Annual Symposium on Principles on Programming Languages, pp. 233–246 (1995)

    Google Scholar 

  8. Maraist, J., Odersky, M., Wadler, P.: The call-by-need lambda calculus. Journal of Functional Programming 8, 275–317 (1998)

    Article  MathSciNet  MATH  Google Scholar 

  9. Danvy, O., Millikin, K., Munk, J., Zerny, I.: Defunctionalized interpreters for call-by-need evaluation. In: Blume, M., Kobayashi, N., Vidal, G. (eds.) FLOPS 2010. LNCS, vol. 6009, pp. 240–256. Springer, Heidelberg (2010)

    Chapter  Google Scholar 

  10. Danvy, O., Zerny, I.: Three syntactic theories for combinatory graph reduction. In: Alpuente, M. (ed.) 20th International Symposium on Logic-Based Program Synthesis and Transformation (2010) (invited talk)

    Google Scholar 

  11. Felleisen, M., Hieb, R.: The revised report on the syntactic theories of sequential control and state. Theoretical Computer Science 103, 235–271 (1992)

    Article  MathSciNet  MATH  Google Scholar 

  12. Kelsey, R.: Tail-recursive stack disciplines for an interpreter. Technical Report NU-CCS-93-03, Northeastern University (1993)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2011 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Chang, S., Van Horn, D., Felleisen, M. (2011). Evaluating Call-by-Need on the Control Stack. In: Page, R., Horváth, Z., Zsók, V. (eds) Trends in Functional Programming. TFP 2010. Lecture Notes in Computer Science, vol 6546. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-22941-1_1

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-22941-1_1

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-22940-4

  • Online ISBN: 978-3-642-22941-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics