Abstract
This paper discusses some of the pros and cons of extending a simple functional language called SAC (for Single Assignment C) by array operations similar to those that are available in apl. The array operations in SAC are based on the Ψ-calculus, an algebra of arrays which provides a formalism for specifying and simplifying array operations in terms of index set manipulations.
The programming techniques made possible by SAC are demonstrated by means of a functional program for the approximation of numerical solutions of partial differential equations by multigrid relaxation. This application is not only of practical relevance but also fully exposes the flavors of using high-level array operations. In contrast to specifications in other languages, e.g. in FORTRAN or SISAL, the SAC program is well structured, reasonably concise, and — what is most important — invariant against dimensionalities and shapes. However, sophisticated compilation techniques are necessary to avoid, whenever possible, the creation of temporary arrays and to eliminate redundant operations.
The paper also includes performance figures for a SAC implementation of the NAS-mgrid-benchmark which are competetive with those of a SISAL implementation.
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
W.B. Ackerman and J.B. Dennis: VAL-A Value-Oriented Algorithmic Language: Preliminary Reference Manual. TR 218, MIT, Cambridge, MA, 1979.
Arvind, K.P. Gostelow, and W. Plouffe: The ID-Report: An asynchronous Programming Language and Computing Machine. Technical Report 114, University of California at Irvine, 1978.
P. Achten and R. Plasmeijer: The ins and outs of Clean I/O. Journal of Functional Programming, Vol. 5(1), 1995, pp. 81–110.
D. Bailey, E. Barszcz, J. Barton, et al.: The NAS Parallel Benchmarks. RNR 94-007, NASA Ames Research Center, 1994.
A.P.W. Böhm, D.C. Cann, R.R. Oldehoeft, and J.T. Feo: SISAL Reference Manual Language Version 2.0. CS 91-118, Colorado State University, Fort Collins, Colorado, 1991.
A. Brandt: Multigrid Methods: 1984 Guide. Dept of applied mathematics, The Weizmann Institute of Science, Rehovot/Israel, 1984.
D.C. Cann: Compilation Techniques for High Performance Applicative Computation. Technical Report CS-89-108, Lawrence Livermore National Laboratory, LLNL, Livermore California, 1989.
D.C. Cann: Retire Fortran? A Debate Rekindled. Communications of the ACM, Vol. 35(8), 1992, pp. 81–89.
D.C. Cann and P. Evripidou: Advanced Array Optimizations for High Performance Functional Languages. IEEE Transactions on Parallel and Distributed Systems, Vol. 6(3), 1995, pp. 229–239.
S.M. Fitzgerald and R.R. Oldehoeft: Update-in-place Analysis for True Multidimensional Arrays. In A.P.W. Böhm and J.T. Feo (Eds.): High Performance Functional Computing, 1995, pp. 105–118.
C. Grelck and S.B. Scholz: Classes and Objects as Basis for I/O in SAC. In T. Johnsson (Ed.): Proceedings of the Workshop on the Implementation of Functional Languages'95. Chalmers University, 1995, pp. 30–44.
K. Hammond, L. Augustsson, B. Boutel, et al.: Report on the Programming Language Haskell: A Non-strict, Purely Functional Language. University of Glasgow, 1995. Version 1.3.
W. Hackbusch: Multi-grid Methods and Applications. Springer, 1985.
W. Hackbusch and U. Trottenberg: Multigrid Methods. LNM, Vol. 960. Springer, 1982.
K.E. Iverson: A Programming Language. Wiley, New York, 1962.
W. Kluge: A User's Guide for the Reduction System π- Red. Internal Report 9419, University of Kiel, 1994.
L.M. Restifo Mullin and M. Jenkins: A Comparison of Array Theory and a Mathematics of Arrays. In Arrays, Functional Languages and Parallel Systems. Kluwer Academic Publishers, 1991, pp. 237–269.
L.M. Restifo Mullin: A Mathematics of Arrays. PhD thesis, Syracuse University, 1988.
L.M. Restifo Mullin: The//-Function: A Basis for FFP with Arrays. In L.M. Restifo Mullin (Ed.): Arrays, Functional Languages and Parallel Systems. Kluwer Academic Publishers, 1991, pp. 185–201.
R.S. Nikhil: ID Version 88.1, Reference Manual. CSG Memo 284, MIT, Laboratory for Computer Science, Cambridge, MA, 1988.
R.R. Oldehoeft: Implementing Arrays in SISAL 2.0. In Proceedings of the Second SISAL Users' Conference, 1992, pp. 209–222.
D. Mac Queen, R.Harper, R. Milner, et al.: Functional Programming in ML. Lfcs education, University of Edinburgh, 1987.
C. Schmittgen, H. Blödorn, and W.E. Kluge: π-RED✶ — a Graph Reducer for Full-Fledged λ-Calculus. New Generation Computing, Vol. 10(2), 1992, pp. 173–195.
C. Schmittgen: A Datatype Architecture for Reduction Machines. In 19th Hawaii International Conference on System Sciences, Vol. 1,1986, pp. 78–87.
S.-B. Scholz: Single Assignment C — Functional Programming Using Imperative Style. In John Glauert (Ed.): Proceedings of the 6th International Workshop on the Implementation of Functional Languages. University of East Anglia, 1994.
S.-B. Scholz: Single Assignment C — Entwurf und Implementierung einer funktionalen C-Variante mit spezieller Unterstützung shape-invarianter Array-Operationen. PhD thesis, Institut für Informatik und praktische Mathematik, Universität Kiel, 1996.
S. Skedzielewski and M.L. Welcome: Data Flow Graph Optimization in IF1. In FPCA '85, Nancy, LNCS, Vol. 201. Springer, 1985, pp. 17–34.
H-C. Tu and A.J. Perlis: FAC: A Functional APL Language. IEEE Software, Vol. 3(1), 1986, pp. 36–45.
H-C. Tu: FAC: Functional Array Calculator and its Application to APL and Functional Programming. PhD thesis, Yale University, 1986.
D.A. Turner: An Overview of Miranda. SIGPLAN Notices, Vol. 21(12), 1986, pp. 158–166.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1997 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Scholz, SB. (1997). On programming scientific applications in SAC — A functional language extended by a subsystem for high-level array operations. 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_20
Download citation
DOI: https://doi.org/10.1007/3-540-63237-9_20
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