Thunk Lifting: Reducing Heap Usage in an Implementation of a Lazy Functional Language

Thunk-lifting is a programtransformation for lazy functional programs. The transforma- tion aims at reducing the amount of heap space allocated to the program when it executes. Thunk-lifting transforms a function application that contains as arguments further, nested, function applications into a new function application without nesting. The transformation thus essentially folds some function applications. The applications to be folded are selected on the basis of a set of conditions, which have been chosen such that thunk-lifting never increases the amount of heap space required by a transformed program. Thunk-lifting has been implemented and applied to a number ofmediumsize benchmark programs. The results show that the number of cell claims in the heap decreases on average by 5%, with a maximum of 16%.

[1]  Willem G. Vree,et al.  Arrays in a lazy functional language -- a case study: the fast Fourier transform , 1992 .

[2]  Academisch Proefschrift,et al.  Simulating Computer Architectures , 1993 .

[3]  Hendrik L. Muller,et al.  Simulating computer architectures , 1993 .

[4]  Quentin F. Stout,et al.  Supporting Divide-and-Conquer Algorithms for Image Processing , 1987, J. Parallel Distributed Comput..

[5]  Kevin Hammond,et al.  Spiking Your Caches , 1993, Functional Programming.

[6]  Simon L. Peyton Jones,et al.  Unboxed Values as First Class Citizens in a Non-Strict Functional Language , 1991, FPCA.

[7]  Simon L. Peyton Jones,et al.  The Implementation of Functional Programming Languages , 1987 .

[8]  Pieter H. Hartel,et al.  Compilation of functional languages using flow graph analysis , 1994, Softw. Pract. Exp..

[9]  Hugh Glaser,et al.  On the benefits of different analyses in the compilation of functional languages , 1991 .

[10]  H. H. Wang,et al.  A Parallel Method for Tridiagonal Equations , 1981, TOMS.

[11]  Rutger F. H. Hofman,et al.  Parallelization of Branch-and-Bound Algorithms in a Functional Programming Environment , 1992 .

[12]  Pieter H. Hartel,et al.  Benchmarking implementations of lazy functional languages , 1993, FPCA '93.

[13]  Simon L. Peyton Jones,et al.  Implementing lazy functional languages on stock hardware: the Spineless Tagless G-machine , 1992, Journal of Functional Programming.

[14]  Pieter H. Hartel,et al.  FCG: A Code Generator for Lazy Functional Languages , 1992, CC.