Skip to main content

High Level Specification of I/O in Functional Languages

  • Conference paper

Part of the book series: Workshops in Computing ((WORKSHOPS COMP.))

Abstract

The interface with the outside world has always been one of the weakest points of functional languages. It is not easy to incorporate I/O without being allowed to do side-effects. Furthermore, functional languages allow redexes to be evaluated in any order while I/O generally has to be performed in a very specific order. In this paper we present a new solution for the I/O problem which we have incorporated in the language Concurrent Clean. Concurrent Clean offers a linear type system called Unique Types. It makes it possible to define functions with side-effects without violating the functional semantics. Now it is possible to change any object in the world in the way we wanted: e.g. arrays can be updated in-situ, arbitrary file manipulation is possible. We have used this powerful tool among others to create a library for window based I/O. Using an explicit environment passing scheme provides a high-level and elegant functional specification method for I/O, called Event I/O. Now the specification of I/O has become one of the strengths of functional languages: interactive programs written in Concurrent Clean are concise, easy to write and comprehend as well as efficient. The presented solution can in principle be applied for any other functional language as well provided that it actually uses graph rewriting semantics in the implementation.

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

Buying options

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

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Achten PM. Operational Semantics of Clean Event I/O. Technical report - in preparation University of Nijmegen.

    Google Scholar 

  2. Backus J. Can Programming Be Liberated from the von Neumann Style? A Functional Style and Its Algebra of Programs.In: Communications of the ACM, Vol.21 Nr. 8, 1978.

    Google Scholar 

  3. Backus J, Williams J, Wimmers E. An introduction to the programming language FL. In: Turner A (ed) Research topics in Functional Programming, Addison-Wesley Publishing Company, 1990.

    Google Scholar 

  4. Barendregt HP, Eekelen van MCJD, Glauwert JRW et al. `Term Graph Reduction’. In: Proceedings of Parallel Architectures and Languages Europe, Eindhoven, The Netherlands, LNCS 259, Vol. II. Springer-Verlag, Berlin, 1990, pp. 141–158.

    Google Scholar 

  5. Brus T, Eekelen van MCJD, Plasmeijer MJ and Barendregt HP. Clean–A Language for Functional Graph Rewriting. In: Proc. of Conference on Functional Programming Languages and Computer Architecture, Portland, Oregon, USA, Springer Verlag, LNCS 274, 1987, pp. 364–384.

    Google Scholar 

  6. Eekelen van MCJD, Huitema HS, Nöcker EGJMH, Smetsers JEW and Plasmeijer MJ. Concurrent Clean Language Manual - version 0.8. Technical report No. 92–18 Department of Informatics, Faculty of Mathematics and Informatics, University of Nijmegen 1992.

    Google Scholar 

  7. Girard J-Y. Linear Logic. In: Theoretical Computer Science 50. 1987, pp. 1–102.

    Google Scholar 

  8. Groningen van JHG, Nöcker EGJMH and Smetsers JEW. Efficient Heap Management in the Concrete ABC Machine. In: Proc. of Third International Workshop on Implementation of Functional Languages on Parallel Architectures. University of Southampton, UK 1991. Technical Report Series CSTR91–07.

    Google Scholar 

  9. Darlington P. Purely Functional Operating Systems. In: Darlington, Henderson, Turner (ed) Functional programming and its applications.

    Google Scholar 

  10. Dwelly A. Functions and Dynamic User Interfaces. In: Proc. of ACM 1989. pp. 371–381.

    Google Scholar 

  11. Hughes J. Why Functional Programming Matters. In: Turner DA (ed) Research topics in Functional Programming. Addison-Wesley Publishing Company, 1990.

    Google Scholar 

  12. Nöcker EGJMH, Smetsers JEW, Eekelen van MCJD and Plasmeijer MJ. Concurrent Clean. In: Proc. of Parallel Architectures and Languages Europe, Eindhoven, The Netherlands. Springer Verlag, LNCS 505. 1990. pp. 202–219.

    Google Scholar 

  13. Perry N. Functional I/O - a solution. Department of Computing, Imperial College, London, Draft version, July 1988.

    Google Scholar 

  14. Peyton Jones SL, Wadler Ph. Imperative Functional Programming. Extended Abstract, to appear in POPL 1993, University of Glasgow.

    Google Scholar 

  15. Pillich L. Portable Clean Event I/O. Department of informatics, Faculty of Mathematics and Informatics, University of Nijmegen. Master Thesis 230, July 1992.

    Google Scholar 

  16. Plasmeijer MJ, Eekelen van MCJD. Functional Programming and Parallel Graph Rewriting. Lecture notes. University of Nijmegen 1991/1992. To appear: Addison Wesley 1993.

    Google Scholar 

  17. Smetsers JEW, Nöcker EGJMH, Groningen van JHG and Plasmeijer MJ. Generating Efficient Code for Lazy Functional Languages. In: Proc. of Conference on Functional Programming Languages and Computer Architecture Cambridge, MA, USA, Springer Verlag, LNCS 523, 1991, pp. 592–617.

    Google Scholar 

  18. Smetsers JEW, Achten PM, Eekelen van MCJD and Plasmeijer MJ. An Unique Type Predicate and its Application for Efficient Code Generation for Functional Languages. Technical report - in preparation. University of Nijmegen.

    Google Scholar 

  19. Thompson S. Interactive Functional Programs. A Method and a Formal Semantics. In: Turner DA (ed) Research topics in Functional Programming, Addison-Wesley Publishing Company, University of Kent, 1990.

    Google Scholar 

  20. Turner DA. An Approach to Functional Operating Systems. In: Turner DA (ed) Research topics in Functional Programming, Addison-Wesley Publishing Company, University of Kent, 1990.

    Google Scholar 

  21. Wadler Ph. Linear types can change the world! In: Broy M, Jones CB (ed) Programming Concepts and Methods, North-Holland, 1990.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 1993 British Computer Society

About this paper

Cite this paper

Achten, P., van Groningen, J., Plasmeijer, R. (1993). High Level Specification of I/O in Functional Languages. In: Launchbury, J., Sansom, P. (eds) Functional Programming, Glasgow 1992. Workshops in Computing. Springer, London. https://doi.org/10.1007/978-1-4471-3215-8_1

Download citation

  • DOI: https://doi.org/10.1007/978-1-4471-3215-8_1

  • Publisher Name: Springer, London

  • Print ISBN: 978-3-540-19820-8

  • Online ISBN: 978-1-4471-3215-8

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics