Tail recursion without space leaks
Richard Jones · Journal of Functional Programming · 1992
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.
Cited by 40 works. doi:10.1017/s0956796800000277 Open-access PDF
Authors
References
- A new implementation technique for applicative languages
- The implementation of functional programming languages
- Tim: A simple, lazy abstract machine to execute supercombinators
- Some practical methods for rapid combinator reduction
- Algorithmic Language and Program Development
- The spineless tagless G-machine
- 1986 ACM Conference on Lisp and Functional Programming
- The spineless G-machine
- The implementation of functional languages using custom hardware
- Fixing some space leaks with a garbage collector