Abstract
We present a new approach to implementing arrays in a pure lazy functional programming language. The arrays can be updated destructively by using uniqueness typing, and the elements can be unboxed. We describe the implementation of these arrays in the functional programming language Clean 1.1. The performance of two sorting algorithms and a fast fourier transformation written in Clean using arrays is compared with similar programs written in C. The current implementation of Clean is on average about 25 percent slower than C for these programs.
Preview
Unable to display preview. Download preview PDF.
References
Andersen, S. and P. Hudak. 1990. Compilation of Haskell Array Comprehensions for Scientific Computing. In Proc. of the ACM SIGPLAN'90 Conf. on Programming Language Design and Implementation, New York, pp. 137–149.
Barendsen E., and J.E.W. Smetsers. 1993. Conventional and Uniqueness Typing in Graph Rewrite Systems. In proceedings 13th conference Foundations of Software Technology and Theoretical Computer Science, Bombay, India, December 1993, pp. 41–51, LNCS 761.
Feo, J. A Comparative Study of Parallel Programming Languages: The Salishan Problems. 1992. North Holland, ISBN 0-444-88135-2.
Fitzgerald, S.M. and R.R. Oldehoeft. 1995. Update-in-place Analysis for rue Multidimensional Arrays. High Performance Functional Computing, pp. 105–118.
Jones, M.P. 1995. A system of constructor classes: overloading and implicit higher-order polymorphism. In Journal of Functional Programming 5(1) — January 1995, Cambridge University Press, pp. 1–35.
Nöcker, E.G.J.M.H., and J.E.W. Smetsers. 1993. Partially strict nonrecursive data types. In Journal of Functional Programming 3(2), pp. 191–215.
Leroy X. 1992. Unboxed objects and polymorphic typing. Proc. 19th Symp. Principles of Programming Languages, pp. 177–188.
Mullin, L.R., W.E. Kluge and S. Scholz. 1996. On Programming Scientific Applications in SAC — a Functional Language Extended by a Subsystem for High-Level Array Operations. Proc. of the 8th International Workshop on Implementation of Functional Languages.
Peyton Jones, S.L. and J. Launchbury. 1991. Unboxed values as first class citizens in a non-strict functional language. In Proc. of Conference on Functional Programming Languages and Computer Architecture (FPCA `91), Sept. 1991, Cambridge, LNCS 523.
Peyton Jones, S.L. and P. Wadler. 1992. Imperative functional programming. ACM Symposium on Principles of Programming Languages (POPL), pp.71–84.
Plasmeijer, M.J., and M.C.J.D. van Eekelen. 1995. Clean 1.1 Reference Manual. Technical Report. University of Nijmegen, The Netherlands.
Serrarens, P.R. A Clean Conjugate Gradient Algorithm. 1996. Proc. of the 8th International Workshop on Implementation of Functional Languages..
Smetsers, J.E.W., E.G.J.M.H. Nöcker, J.H.G. van Groningen and M.J. Plasmeijer. 1991. Generating Efficient Code for Lazy Functional Languages, In Proc. of Conference on Functional Programming Languages and Computer Architecture (FPCA '91), Cambridge, MA, USA, Springer-Verlag, LNCS 523, pp. 592–617.
Wadler. P. 1986. A new array operation for functional languages. In Proc. Graph Reduction Workshop, Santa Fe, Springer Verlag, LNCS 295.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1997 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
van Groningen, J.H.G. (1997). The implementation and efficiency of arrays in clean 1.1. In: Kluge, W. (eds) Implementation of Functional Languages. IFL 1996. Lecture Notes in Computer Science, vol 1268. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-63237-9_21
Download citation
DOI: https://doi.org/10.1007/3-540-63237-9_21
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-63237-5
Online ISBN: 978-3-540-69239-3
eBook Packages: Springer Book Archive