Advertisement

FCG: A code generator for lazy functional languages

  • Koen Langendoen
  • Pieter H. Hartel
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 641)

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.

Keywords

Basic Block Garbage Collection Functional Language Assembly Code Garbage Collector 
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

  1. [1]
    A. Aho, R. Sethi, and J. Ullman. Compilers: Principles, Techniques, and Tools. Addison Wesley, Reading, Massachusetts, 1986.Google Scholar
  2. [2]
    L. Augustsson and T. Johnsson. The Chalmers lazy-ML compiler. The Computer Journal, 32(2):127–141, Apr. 1989.Google Scholar
  3. [3]
    C. J. Cheney. A non-recursive list compacting algorithm. CACM, 13(11):677–678, Nov. 1970.Google Scholar
  4. [4]
    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.Google Scholar
  5. [5]
    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.Google Scholar
  6. [6]
    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.Google Scholar
  7. [7]
    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.Google Scholar
  8. [8]
    T. Johnsson. Efficient compilation of lazy evaluation. SIGPLAN notices, 19(6):58–69, June 1984.Google Scholar
  9. [9]
    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.Google Scholar
  10. [10]
    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.Google Scholar
  11. [11]
    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.Google Scholar
  12. [12]
    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.Google Scholar
  13. [13]
    Q. F. Stout. Supporting divide-and-conquer algorithms for image processing. J. Parallel and Distributed Computing, 4(1):95–115, Feb. 1987.Google Scholar
  14. [14]
    W. G. Vree. Design considerations for a parallel reduction machine. PhD thesis, Dept. of Comp. Sys, Univ. of Amsterdam, Dec. 1989.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1992

Authors and Affiliations

  • Koen Langendoen
    • 1
  • Pieter H. Hartel
    • 1
  1. 1.University of AmsterdamSJ AmsterdamThe Netherlands

Personalised recommendations