Evaluating Call-by-Need on the Control Stack

  • Stephen Chang
  • David Van Horn
  • Matthias Felleisen
Part of the Lecture Notes in Computer Science book series (LNCS, volume 6546)

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.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Plotkin, G.D.: Call-by-name, call-by-value and the λ-calculus. Theoretical Computer Science 1, 125–159 (1975)MathSciNetCrossRefMATHGoogle Scholar
  2. 2.
    Ariola, Z.M., Felleisen, M.: The call-by-need lambda calculus. Journal of Functional Programming 7, 265–301 (1997)MathSciNetCrossRefMATHGoogle Scholar
  3. 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. 4.
    Barendregt, H.P.: The Lambda Calculus: Its Syntax and Semantics. North Holland, Amsterdam (1981)MATHGoogle Scholar
  5. 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. 6.
    Felleisen, M., Findler, R.B., Flatt, M.: Semantics Engineering with PLT Redex. MIT Press, Cambridge (2009)MATHGoogle Scholar
  7. 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. 8.
    Maraist, J., Odersky, M., Wadler, P.: The call-by-need lambda calculus. Journal of Functional Programming 8, 275–317 (1998)MathSciNetCrossRefMATHGoogle Scholar
  9. 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)CrossRefGoogle Scholar
  10. 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. 11.
    Felleisen, M., Hieb, R.: The revised report on the syntactic theories of sequential control and state. Theoretical Computer Science 103, 235–271 (1992)MathSciNetCrossRefMATHGoogle Scholar
  12. 12.
    Kelsey, R.: Tail-recursive stack disciplines for an interpreter. Technical Report NU-CCS-93-03, Northeastern University (1993)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2011

Authors and Affiliations

  • Stephen Chang
    • 1
  • David Van Horn
    • 1
  • Matthias Felleisen
    • 1
  1. 1.PLT & PRLNortheastern UniversityBostonUSA

Personalised recommendations