Abstract
The FCG code generator produces portable code that supports efficient twospace copying garbage collection. The code generator transforms the output of the FAST compiler front end into an abstract machine code. This code explicitly uses a call stack, which is accessible to the garbage collector. In contrast to other functional language compilers that generate assembly directly, FCG uses the C compiler for code generation, providing high-quality code optimisations and portability. To make full use of the C compiler's capabilities, FCG includes an optimisation scheme that transforms the naively generated stack-based code into a register-based equivalent form. The results for a benchmark of functional programs show that code generated by FCG performs well in comparison with the LML compiler.
Chapter PDF
Similar content being viewed by others
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
References
A. Aho, R. Sethi, and J. Ullman. Compilers: Principles, Techniques, and Tools. Addison Wesley, Reading, Massachusetts, 1986.
L. Augustsson and T. Johnsson. The Chalmers lazy-ML compiler. The Computer Journal, 32(2):127–141, Apr. 1989.
C. J. Cheney. A non-recursive list compacting algorithm. CACM, 13(11):677–678, Nov. 1970.
J. Glas. The parallelization of branch and bound algorithms in a functional programming language. Masters thesis, Dept. of Comp. Sys, Univ. of Amsterdam, Apr. 1992.
P. H. Hartel, H. W. Glaser, and J. M. Wild. Compilation of functional languages using flow graph analysis. Technical report CSTR 91-03, Dept. of Comp. Sci, Univ. of Southampton, UK, Jan. 1991.
P. H. Hartel, H. W. Glaser, and J. M. Wild. On the benefits of different analyses in the compilation of functional languages. In H. W. Glaser and P. H. Hartel, editors, Implementation of functional languages on parallel architectures, pages 123–145. CSTR 91-07, Dept. of Electronics and Comp. Sci, Univ. of Southampton, UK, June 1991.
P. H. Hartel and W. G. Vree. Arrays in a lazy functional language — a case study: the fast Fourier transform. Technical report CS-92-02, Dept. of Comp. Sys, Univ. of Amsterdam, May 1992.
T. Johnsson. Efficient compilation of lazy evaluation. SIGPLAN notices, 19(6):58–69, June 1984.
R. Loogen, H. Kuchen, K. Indermark, and W. Damm. Distributed implementation of programmed graph reduction. In E. Odijk, M. Rem, and J.-C. Syre, editors, Parallel languages and architectures (PARLE), LNCS 366, pages 136–157, Eindhoven, Netherlands, June 1989. Springer Verlag.
S. L. Peyton Jones. The spineless tagless G-machine: a second attempt In H. W. Glaser and P. H. Hartel, editors, Implementation of functional languages on parallel architectures, pages 147–191. CSTR 91-07, Dept. of Electronics and Comp. Sci, Univ. of Southampton, UK, June 1991.
W. Schulte and W. Grieskamp. Generating efficient portable code for a strict applicative language. In J. Darlington and R. Dietrich, editors, Declarative programming, pages 239–252, Sasbachwalden, West Germany, Nov. 1991. Springer Verlag.
S. Smetsers, E. G. J. M. H. Nöcker, J. van Groningen, and M. J. Plasmeijer. Generating efficient code for lazy functional languages. In R. J. M. Hughes, editor, 5th Functional programming languages and computer architecture, LNCS 523, pages 592–617, Cambridge, Massachusetts, Sept. 1991. Springer Verlag.
Q. F. Stout. Supporting divide-and-conquer algorithms for image processing. J. Parallel and Distributed Computing, 4(1):95–115, Feb. 1987.
W. G. Vree. Design considerations for a parallel reduction machine. PhD thesis, Dept. of Comp. Sys, Univ. of Amsterdam, Dec. 1989.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1992 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Langendoen, K., Hartel, P.H. (1992). FCG: A code generator for lazy functional languages. In: Kastens, U., Pfahler, P. (eds) Compiler Construction. CC 1992. Lecture Notes in Computer Science, vol 641. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-55984-1_26
Download citation
DOI: https://doi.org/10.1007/3-540-55984-1_26
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-55984-9
Online ISBN: 978-3-540-47335-0
eBook Packages: Springer Book Archive