Tail recursion without space leaks
- 1 January 1992
- journal article
- Published by Cambridge University Press (CUP) in Journal of Functional Programming
- Vol. 2 (1) , 73-79
- https://doi.org/10.1017/s0956796800000277
Abstract
The G-machine (Johnsson, 1987; Peyton Jones, 1987) is a compiled graph reduction machine for lazy functional languages. The G-machine compiler contains many optimizations to improve performance. One set of such optimizations is designed to improve the performance of tail recursive functions. Unfortunately, the abstract machine is subject to a space leak—objects are unnecessarily preserved by the garbage collector. This paper analyses why a particular form of space leak occurs in the G-machine, and presents some ideas for fixing this problem. This phenomena in other abstract machines is also examined briefly.Keywords
This publication has 6 references indexed in Scilit:
- The spineless tagless G-machinePublished by Association for Computing Machinery (ACM) ,1989
- The spineless G-machinePublished by Association for Computing Machinery (ACM) ,1988
- Fixing some space leaks with a garbage collectorSoftware: Practice and Experience, 1987
- Tim: A simple, lazy abstract machine to execute supercombinatorsPublished by Springer Nature ,1987
- Algorithmic Language and Program DevelopmentPublished by Springer Nature ,1982
- A new implementation technique for applicative languagesSoftware: Practice and Experience, 1979