MetaCartSign in to MyCiteSeer

Include Citations | Advanced Search | Help

Include Citations | Advanced Search | Help

  Lazy Functional Languages

Download:
pdf | ps
by Sjaak Smetsers, Eric Nocker, John Van Groningen, Rinus Plasmeijer
ftp://ftp.cs.kun.nl/pub/Clean/papers/1991/smes91-codegeneration.ps.gz
Add To MetaCart

Abstract:

In this paper we will discuss how a good code generator can be built for (lazy) functional languages. Starting from Concurrent Clean, an experimental lazy functional programming language, code is generated for an intermediate abstract machine: the ABC machine. In this first pass many well-known optimisation techniques are included. However, we will also present some new ideas in this area, like the way in which strictness can be incorporated, and the implementation of higher order functions. In a second pass, the ABC code is translated to concrete target code for the Motorola MC680x0 processor. Again many optimisation methods appear to be applicable. Some of them (for example register allocation algorithms) are common for the implementation of other types of languages, but have to be adapted because of the specific properties of both source language and target machine. Other optimisations are specific for lazy functional languages, e.g. the implementation of higher order functions, efficient memory management and the optimised graph reduction. Measurements demonstrate that due to the optimisations of both passes very fast code can be generated. We have compared Concurrent Clean with two other functional languages, namely Lml and Hope, and also with the imperative language C. With respect to both functional languages this comparison clearly goes in favour of Concurrent Clean. Furthermore, we can conclude that, when using the presented compilation techniques, a lazy functional language is able to compete even with an imperative language such as C. 1.

Citations

81 Polymorphic Type Schemes and Recursive Definitions – Mycroft - 1984
72 A Theory of Type Polymorphism – Milner - 1978
66 Concurrent Clean – Nocker, Smetsers, et al. - 1991
65 Clean - A Language for Functional Graph Rewriting – Brus, Eekelen, et al. - 1987
47 The Spineless Tagless G-machine – Jones, Salkild - 1989
36 Hope: an experimental applicative language – Burstall, MacQueen, et al. - 1980
18 Term Graph Reduction – Barendregt, Eekelen, et al. - 1987
9 The Chalmers Lazy-ML compiler. The computer journal – Augustsson, Johnsson - 1989
7 Parallel Graph Rewriting on Loosely Coupled Machine Architectures – van, Plasmeijer, et al. - 1990
5 Concurrent Clean on Transputers – Kesseler - 1990
5 The ABC-machine: A Sequential Stack-based Abstract Machine For Graph Rewriting – Koopman, Eekelen, et al. - 1990
4 and Sjaak Smetsers – Barendsen - 1992
4 Strictness analysis based on abstract reduction – Nocker - 1990
3 Concurrent clean, version 0.6 – Eekelen, Nocker, et al. - 1990
3 Concurrent Clean on ZAPP – McBurney, Sleep - 1990
3 The pabc simulator, v0.5. implementation manual – Nocker - 1989
3 Partially strict data types – Nocker, Smetsers - 1990
2 Parallel Graph Rewriting, Some Contributions to its Theory, its Implementation and its Application, Dissertation – Eekelen - 1988
2 Implementing the abc-machine on m680x0 based architectures – Groningen - 1990
2 Compiling Lazy Functional Programming Languages – Johnsson - 1987
2 Eekelen – Plasmeijer, van - 1993