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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Plotkin, G.D.: Call-by-name, call-by-value and the λ-calculus. Theoretical Computer Science 1, 125–159 (1975)
Ariola, Z.M., Felleisen, M.: The call-by-need lambda calculus. Journal of Functional Programming 7, 265–301 (1997)
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)
Barendregt, H.P.: The Lambda Calculus: Its Syntax and Semantics. North Holland, Amsterdam (1981)
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)
Felleisen, M., Findler, R.B., Flatt, M.: Semantics Engineering with PLT Redex. MIT Press, Cambridge (2009)
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)
Maraist, J., Odersky, M., Wadler, P.: The call-by-need lambda calculus. Journal of Functional Programming 8, 275–317 (1998)
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)
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)
Felleisen, M., Hieb, R.: The revised report on the syntactic theories of sequential control and state. Theoretical Computer Science 103, 235–271 (1992)
Kelsey, R.: Tail-recursive stack disciplines for an interpreter. Technical Report NU-CCS-93-03, Northeastern University (1993)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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)