Abstract
In this paper we introduce a new method of implementing lazy evaluation efficiently in the TIM. A major advantage of the TIM [4] over other abstract machines is that it can take advantage of the results of sharing analysis. In this paper, we demonstrate that despite this advantage the sharing mechanism of the original TIM suffers from two serious flaws: expensive shared partial applications (in both space and time); and redundant updates. We devise a more general notation for expressing sharing than that introduced in [4]. This allows us to demonstrate that the sole reason for the defects in the TIM sharing mechanism is its treatment of sharing as a local property of arguments. Consequently we propose a new scheme where sharing is treated as a global property of expressions. This eliminates the problem of redundant updates and opens the way for several improvements including: cheap shared partial applications (in both space and time); and better synergy between the caller and the callee.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Bibliography
Augustsson, L. 1987. Compiling Lazy Functional Languages, Part II. PhD thesis, Chalmers University of Technology.
Burn, G., Peyton Jones, S.L. and Robson, J.D. 1988. The Spineless G-machine. ACM Symposium on Lisp and Functional Programming.Salt Lake City.
Fairbairn, J. and Wray, S.C. 1986. Code generation techniques for functional languages. Proceedings of the ACM Symposium on Lisp and Functional Programming. Cambridge.
Fairbairn, J. and Wray, S.C. 1987. TIM: a simple abstract machine for executing super-combinators. Proceedings of the Conference on Functional Languages and Computer Architecture. Portland.
Johnsson, T. 1987. Compiling Lazy Functional Languages. PhD thesis. Chalmers University of Technology.
Kieburtz, R.B. and Agapiev, B. 1989. Optimizing the evaluation of suspensions. Unpublished draft.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 1992 British Computer Society
About this paper
Cite this paper
Argo, G. (1992). A New Sharing Mechanism for the TIM. In: Heldal, R., Holst, C.K., Wadler, P. (eds) Functional Programming, Glasgow 1991. Workshops in Computing. Springer, London. https://doi.org/10.1007/978-1-4471-3196-0_2
Download citation
DOI: https://doi.org/10.1007/978-1-4471-3196-0_2
Publisher Name: Springer, London
Print ISBN: 978-3-540-19760-7
Online ISBN: 978-1-4471-3196-0
eBook Packages: Springer Book Archive