Skip to main content

M-structures: Extending a parallel, non-strict, functional language with state

  • Conference paper
  • First Online:
Functional Programming Languages and Computer Architecture (FPCA 1991)

Abstract

Functional programs are widely appreciated for being “declarative” (algorithms are not over-specified) and implicitly paralle. However, when modeling state, both properties are compromised because the state variables must be “threaded” through most functions. Further, state “up-dates” may require much copying. A solution is to introduce assignments, as in ML and Scheme; however, for meaningful semantics, they resort to strict, sequential evaluation.

We present an alternative approach called M-structures, which are imperative data structures with implicit synchronization. M-structures are added to Id, a parallel non-strict functional language. We argue that some programs with M-structures improve on their functional counterparts in three ways: they are (1) more declarative; (2) more parallel; and (3) more storage efficient. Points (1) and (2) contradict conventional wisdom. We study two problems: histogramming a tree, and graph traversal, comparing functional and M-structure solutions.

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

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Z. M. Ariola and Arvind. P-TAC: A Parallel Intermediate Language. In Proceedings of the Fourth Conference on Functional Programming Languages and Computer Architecture, London, pages 230–242, September 1989.

    Google Scholar 

  2. Arvind and J. D. Brock. Resource Managers in Functional Programming. Journal of Parallel and Distributed Computing, 1(1), June 1984.

    Google Scholar 

  3. Arvind, D. Culler, and G. Maa. Assessing the Benefits of Fine-Grained Parallelism in Dataflow Programs. International Journal of Supercomputing Applications, 2(3), 1988.

    Google Scholar 

  4. Arvind, K. P. Gostelow, and W. Plouffe. Indeterminacy, Monitors and Dataflow. Operating Systems Review (Proceedings of the Sixth ACM Symposium on Operating Systems Principles), 11(5), November 1977.

    Google Scholar 

  5. Arvind, R. S. Nikhil, and K. K. Pingali. I-Structures: Data Structures for Parallel Computing. ACM Transactions on Programming Languages and Systems, 11(4):598–632, October 1989.

    Google Scholar 

  6. F. W. Burton. Encapsulating Non-determinacy in an Abstract Type with Determinate Semantics. Journal of Functional Programming, 1(1), January 1991.

    Google Scholar 

  7. C. Clack and S. L. Peyton Jones. The Four-Stroke Reduction Engine. In Proceedings of the 1986 ACM Conference on Lisp and Functional Programming, Cambridge, Mass., pages 220–232, August 4–6 1986.

    Google Scholar 

  8. R. H. Halstead. Multilisp: A Language for Concurrent Symbolic Computation. ACM Transactions on Programming Languages and Systems, 7(4):501–539, October 1985.

    Google Scholar 

  9. C. A. R. Hoare. Monitors: An Operating System Structuring Concept. Communications of the ACM, 10(10):549–557, October 1974.

    Google Scholar 

  10. P. Hudak. A Semantic Model of Reference Counting and Its Abstraction. In S. Abramsky and C. Hankin, editors, Abstract Interpretation of Declarative Languages, Computers and Their Applications, chapter 3, pages 45–62. Ellis Horwood Limited, Chichester, West Sussex, England, 1987.

    Google Scholar 

  11. P. Hudak and P. Wadler (editors). Report on the Programming Language Haskell, A Non-strict Purely Functional Language (Version 1.0). Technical Report YALEU/DCS/RR777, Yale University, Department of Computer Science, Apr. 1990.

    Google Scholar 

  12. J. Milewski. Functional Data Structures as Updatable Objects. IEEE Transactions on Software Engineering, 16(12):1427–1432, December 1990.

    Google Scholar 

  13. R. S. Nikhil. Id (Version 90.0) Reference Manual. Technical Report CSG Memo 284-1, MIT Laboratory for Computer Science, 545 Technology Square, Cambridge, MA 02139, USA, July 1990.

    Google Scholar 

  14. R. S. Nikhil. The Parallel Programming Language Id and its Compilation for Parallel Machines. In Proc. Workshop on Massive Parallelism, Amalfi, Italy, October 1989. Academic Press, 1990 (to appear).

    Google Scholar 

  15. R. S. Nikhil and Arvind. Programming in Id: a parallel programming language. 1990. Textbook on implicit parallel programming. In preparation.

    Google Scholar 

  16. G. M. Papadopoulos and D. E. Culler. Monsoon: An Explicit Token Store Architecture. In Proc. 17th. Intl. Symp. on Computer Architecture, Seattle, WA, May 1990.

    Google Scholar 

  17. W. Stoye. Message-Based Functional Operating Systems. Science of Computer Programming, 6:291–311, 1986.

    Google Scholar 

  18. K. R. Traub. Sequential Implementation of Lenient Programming Languages. Technical Report TR-417, MIT Laboratory for Computer Science, 545 Technology Square, Cambridge, MA 02139, May 1988. Ph.D. thesis.

    Google Scholar 

  19. D. Turner. Functional Programming and Communicating Processes. In Proceedings of PARLE: Parallel Architectures and Languages, Europe, Volume II, Eindhoven, The Netherlands, Springer-Verlag Lecture Notes in Computer Science, Volume 259, pages 54–74, June 1987.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Consortia

Editor information

John Hughes

Rights and permissions

Reprints and permissions

Copyright information

© 1991 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Barth, P.S., Nikhil, R.S., Arvind Massachusetts Institute of Technology. (1991). M-structures: Extending a parallel, non-strict, functional language with state. In: Hughes, J. (eds) Functional Programming Languages and Computer Architecture. FPCA 1991. Lecture Notes in Computer Science, vol 523. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3540543961_26

Download citation

  • DOI: https://doi.org/10.1007/3540543961_26

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

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

  • Online ISBN: 978-3-540-47599-6

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics