Abstract
Fairbaim and Wray’s Three Instruction Machine [1, 2] has been one of the most influential lazy abstract machine designs in recent years. However, despite its influence, some of the finer details of the implementation technique remain unclear. We hope this paper will help clarify these details. Taking Fairbaim and Wray’s Normal Order version of the TIM as a starting point the author has produced two improved TIMs: the G-TIM [3], a simple single stack version; and the A-TIM [4], a more ambitious two stack design. In order to simplify the comparison between the two new TIMs and the original, they are compiled down to µTIM, a RISC microcode for TIMs, which is ultimately translated to native code. The resulting implementation, called GRIT (Guy’s RISC Implementation of the Three Instruction Machine), incorporates several novel techniques which simplify the design of the compiler but still produce good quality code. In this paper we describe these techniques and demonstrate that, despite being simpler, they result in performance at least as good as that of the Chalmers’ implementation of the G-machine [5, 6, 7].
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Fairbairn, J. and Wray, S.C. The TIM: a simple abstract machine to execute supercombinators. In: Proceedings of the 1987 Functional Programming and Computer Architecture conference, Portland, Oregon. 1987.
Wray, S. C. and Fairbairn, J. Non-strict languages - programming and implementation. Computer Journal. vol. 32 no. 2 April 1989.
Argo, G.M. Improving the Three Instruction Machine. In: Proceedings of the 1989 Functional Programming and Computer Architecture conference, London. 1989.
Argo, G.M. Efficient laziness. PhD thesis, Glasgow University. to appear 1993.
Augustsson, L. and Johnsson, T. The Chalmers Lazy-ML compiler. Computer Journal. vol. 32 no. 2 April 1989.
Peyton Jones, S. L. The implementation of functional programming languages. Prentice Hall.. 1987.
Peyton Jones, S. L. and Lester D. Implementing functional languages: a tutorial. Prentice Hall.
Partain, W. The nofib benchmark suite of Haskell programs. In: Functional Programming, Glasgow 1992, J. Launchbury and P.M. Sansom Eds., Springer-Verlag, Workshops in Computing Science, Ayr, Scotland, 1992.
Hall, C. Hammond, K. Partain, W. Peyton Jones, S.L. and Wadler, P. The Glasgow Haskell compiler: a retrospective. In: Functional Programming, Glasgow 1992, J. Launchbury and P.M. Sansom Eds., Springer-Verlag, Workshops in Computing Science, Ayr, Scotland, 1992.
Kehler Holst, C. Improving full laziness. In: Functional Programming, Glasgow 1992, S.L. Peyton Jones, G. Hutton and C. Kehler Holst Eds., Springer-Verlag, Workshops in Computing Science, Ullapool, Scotland, 1990.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 1993 British Computer Society
About this paper
Cite this paper
Argo, G. (1993). GRIT: Guy’s RISC Implementation of the Three Instruction Machine. In: Launchbury, J., Sansom, P. (eds) Functional Programming, Glasgow 1992. Workshops in Computing. Springer, London. https://doi.org/10.1007/978-1-4471-3215-8_2
Download citation
DOI: https://doi.org/10.1007/978-1-4471-3215-8_2
Publisher Name: Springer, London
Print ISBN: 978-3-540-19820-8
Online ISBN: 978-1-4471-3215-8
eBook Packages: Springer Book Archive