Skip to main content

Functional Array Programming in SaC

  • Conference paper
Central European Functional Programming School (CEFP 2005)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 4164))

Included in the following conference series:

Abstract

These notes present an introduction into array-based programming from a functional, i.e., side-effect-free perspective.

The first part focuses on promoting arrays as predominant, stateless data structure. This leads to a programming style that favors compositions of generic array operations that manipulate entire arrays over specifications that are made in an element-wise fashion. An algebraicly consistent set of such operations is defined and several examples are given demonstrating the expressiveness of the proposed set of operations.

The second part shows how such a set of array operations can be defined within the first-order functional array language SaC. It does not only discuss the language design issues involved but it also tackles implementation issues that are crucial for achieving acceptable runtimes from such genericly specified array operations.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Allen, R., Kennedy, K.: Optimizing Compilers for Modern Architectures. Morgan Kaufmann Publishers, San Francisco (2001)

    Google Scholar 

  2. Sharp, I.P & Associates. SHARP APL Release 19.0 Guide for APL Programmers. I.P Sharp & Associates Ltd.(1987)

    Google Scholar 

  3. Benkard, J.P.: Extending Structure, Type, and Expression in APL-2. In: Proceedings of the International Conference on Array Processing Languages (APL 1991), Palo Alto, California, USA. APL Quote Quad, vol. 21, pp. 20–29. ACM Press, New York (1991)

    Google Scholar 

  4. Benkard, J.P.: Nested Arrays and Operators — Some Issues in Depth. In: Proceedings of the International Conference on Array Processing Languages (APL 1992), St.Petersburg, Russia. APL Quote Quad, pp. 7–21. ACM Press, New York (1992)

    Google Scholar 

  5. Bernecky, R.: An Introduction to Function Rank. In: Proceedings of the International Conference on Array Processing Languages (APL 1988), Sydney, Australia. APL Quote Quad, vol. 18, pp. 39–43. ACM Press, New York (1988)

    Google Scholar 

  6. Brown, J.: Inside the APL2 Workspace. SIGAPL Quote Quad 15, 277–282 (1985)

    Article  Google Scholar 

  7. Burke, C.: J and APL. Iverson Software Inc., Toronto, Canada (1996)

    Google Scholar 

  8. Cann, D.C.: Compilation Techniques for High Performance Applicative Computation. Technical Report CS-89-108, Lawrence Livermore National Laboratory, LLNL, Livermore California (1989)

    Google Scholar 

  9. Cann, D.C.: Retire Fortran? A Debate Rekindled. Communications of the ACM 35(8), 81–89 (1992)

    Article  Google Scholar 

  10. Cann, D.C.: The Optimizing SISAL Compiler: Version 12.0. Lawrence Livermore National Laboratory, LLNL, Livermore California, Part of the SISAL distribution (1993)

    Google Scholar 

  11. Chin, W.N.: Towards an Automated Tupling Strategy. In: Proceedings of the ACM SIGPLAN Symposium on Partial Evaluation and Semantic-Based Program Manipulation (PEPM 1997), Copenhagen, Denmark, pp. 119–132. ACM Press, New York (1993)

    Chapter  Google Scholar 

  12. Chin, W.-N.: Safe Fusion of Functional Expressions II: Further Improvements. Journal of Functional Programming 4(4), 515–550 (1994)

    Article  Google Scholar 

  13. Chin, W.N.: Fusion and Tupling Transformations: Synergies and Conflicts. In: Proceedings of the Fuji International Workshop on Functional and Logic Programming, Susono, Japan, pp. 106–125. World Scientific Publishing, Singapore (1995)

    Google Scholar 

  14. Chitil, O.: Type Inference Builds a Short Cut to Deforestation. In: Proceedings of the 1999 ACM SIGPLAN International Conference on Functional Programming (ICFP 1999), vol. 34(9), pp. 160–249. ACM Press, New York (1999)

    Google Scholar 

  15. Chakravarty, M.M.T., Keller, G.: Functional Array Fusion. In: Leroy, X. (ed.) Proceedings of ICFP 2001. ACM Press, New York (2001)

    Google Scholar 

  16. Chakravarty, M.M.T., Keller, G.: An Approach to Fast Arrays in Haskell. In: Jeuring, J., Jones, S.L.P. (eds.) AFP 2002. LNCS, vol. 2638, pp. 27–58. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  17. Feo, J.T.: Arrays, Functional Languages, and Parallel Systems. In: Arrays in Sisal, ch. 5, pp. 93–106. Kluwer Academic Publishers, Dordrecht (1991)

    Google Scholar 

  18. Gill, A.: Cheap Deforestation for Non-strict Functional Languages. PhD thesis, Glasgow University (1996)

    Google Scholar 

  19. Grelck, C., Kreye, D., Scholz, S.-B.: On Code Generation for Multi-Generator WITH-Loops in SAC. In: Koopman, P., Clack, C. (eds.) IFL 1999. LNCS, vol. 1868, pp. 77–95. Springer, Heidelberg (2000)

    Chapter  Google Scholar 

  20. Grelck, C.: Implicit Shared Memory Multiprocessor Support for the Functional Programming Language SAC - Single Assignment C. PhD thesis, Institut für Informatik und Praktische Mathematik, Universität Kiel (2001)

    Google Scholar 

  21. Grelck, C., Scholz, S.B.: HPF vs. SAC – A Case Study. In: Bode, A., Ludwig, T., Karl, W.C., Wismüller, R. (eds.) Euro-Par 2000. LNCS, vol. 1900, pp. 620–624. Springer, Heidelberg (2000)

    Chapter  Google Scholar 

  22. Grelck, C., Scholz, S.B.: Axis Control in SaC. In: Peña, R., Arts, T. (eds.) IFL 2002. LNCS, vol. 2670, pp. 182–198. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  23. Grelck, C., Scholz, S.-B., Trojahner, K.: WITH-Loop Scalarization – Merging Nested Array Operations. In: Trinder, P., Michaelson, G.J., Peña, R. (eds.) IFL 2003. LNCS, vol. 3145, pp. 118–134. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

  24. Hu, Z., Iwasaki, H.: Tupling Calculation Eliminates Multiple Data Traversals. In: Proceedings of the 2nd ICFP. ACM Press, New York (1997)

    Google Scholar 

  25. Herhut, S., Scholz, S.-B.: Towards Fully Controlled Overloading Across Module Boundaries. In: Grelck, C., Huch, F., Michaelson, G.J., Trinder, P. (eds.) IFL 2004. LNCS, vol. 3474, pp. 395–408. Springer, Heidelberg (2005)

    Google Scholar 

  26. Hui, R.: Rank and Uniformity. APL Quote Quad 25(4), 83–90 (1995)

    Article  MathSciNet  Google Scholar 

  27. International Standards Organization. International Standard for Programming Language APL. Iso n8485, ISO (1984)

    Google Scholar 

  28. Iverson, K.E.: A Programming Language. Wiley, New York (1962)

    MATH  Google Scholar 

  29. Iverson, K.E.: Programming in J. Iverson Software Inc., Toronto, Canada (1991)

    Google Scholar 

  30. Iverson, K.E.: J Introduction and Dictionary. Iverson Software Inc., Toronto, Canada (1995)

    Google Scholar 

  31. Jenkins, M.A., Falster, P.: Array Theory and NIAL. Technical Report 157, Technical University of Denmark, ELTEK, Lyngby, Denmark (1999)

    Google Scholar 

  32. Jenkins, M.A., Glasgow, J.I.: A Logical Basis for Nested Array Data Structures. Computer Languages Journal 14(1), 35–51 (1989)

    Article  Google Scholar 

  33. Jenkins, M.A., Jenkins, W.H.: The Q’Nial Language and Reference Manuals. Nial Systems Ltd., Ottawa, Canada (1993)

    Google Scholar 

  34. Kreye, D.J.: A Compiler Backend for Generic Programming with Arrays. PhD thesis, Institut für Informatik und Praktische Mathematik, Universität Kiel (2003)

    Google Scholar 

  35. Lin, C.: ZPL Language Reference Manual. UW-CSE-TR 94-10-06, University of Washington (1996)

    Google Scholar 

  36. Lewis, E.C., Lin, C., Snyder, L.: The Implementation and Evaluation of Fusion and Contraction in Array Languages. In: Proceedings of the ACM SIGPLAN 1998 Conference on Programming Language Design and Implementation. ACM, New York (1998)

    Google Scholar 

  37. Restifo Mullin, L.M., Jenkins, M.: A Comparison of Array Theory and a Mathematics of Arrays. In: Arrays, Functional Languages and Parallel Systems, pp. 237–269. Kluwer Academic Publishers, Dordrecht (1991)

    Google Scholar 

  38. Restifo Mullin, L.M.: A Mathematics of Arrays. PhD thesis, Syracuse University (1988)

    Google Scholar 

  39. Nemeth, L., Peyton Jones, S.: A Design for Warm Fusion. In: Clack, C., Davie, T., Hammond, K. (eds.) Proceedings of the 10th International Workshop on Implementation of Functional Languages, pp. 381–393. University College, London (1998)

    Google Scholar 

  40. Peyton Jones, S.L., Wadler, P.: Imperative functional programming. In: POPL 1993. ACM Press, New Orleans (1993)

    Google Scholar 

  41. Scholz, S.-B.: 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)

    Google Scholar 

  42. Scholz, S.-B.: With-loop-folding in sac–Condensing Consecutive Array Operations. In: Clack, C., Hammond, K., Davie, T. (eds.) IFL 1997. LNCS, vol. 1467, pp. 72–92. Springer, Heidelberg (1998)

    Chapter  Google Scholar 

  43. Scholz, S.-B.: A Type System for Inferring Array Shapes. In: Arts, T., Mohnen, M. (eds.) IFL 2002. LNCS, vol. 2312, pp. 65–82. Springer, Heidelberg (2002)

    Google Scholar 

  44. Scholz, S.-B.: Single Assignment C — efficient support for high-level array operations in a functional setting. Journal of Functional Programming 13(6), 1005–1059 (2003)

    Article  MATH  MathSciNet  Google Scholar 

  45. Shafarenko, A., Scholz, S.-B., Herhut, S., Grelck, C., Trojahner, K.: Implementing a Numerical solution of the KPI equation using single Assignment C: lessons and experiences. In: Butterfield, A., Grelck, C., Huch, F. (eds.) IFL 2005. LNCS, vol. 4015, pp. 160–177. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

  46. van Arkel, D., van Groningen, J., Smetsers, S.: Fusion in Practice. In: Peña, R., Arts, T. (eds.) IFL 2002. LNCS, vol. 2670, pp. 51–67. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  47. van Groningen, J.: The Implementation and Efficiency of Arrays in Clean 1.1. In: Kluge, W. (ed.) IFL 1996. LNCS, vol. 1268, pp. 105–124. Springer, Heidelberg (1997)

    Google Scholar 

  48. Wolfe, M.J.: High-Performance Compilers for Parallel Computing. Addison-Wesley, Reading (1995)

    Google Scholar 

  49. Zima, H., Chapman, B.: Supercompilers for Parallel and Vector Computers. Addison-Wesley, Reading (1991)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2006 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Scholz, SB. (2006). Functional Array Programming in SaC . In: Horváth, Z. (eds) Central European Functional Programming School. CEFP 2005. Lecture Notes in Computer Science, vol 4164. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11894100_3

Download citation

  • DOI: https://doi.org/10.1007/11894100_3

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-46843-1

  • Online ISBN: 978-3-540-46845-5

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics