Skip to main content

Mobile Haskell: Compiling lazy functional programs for the Java Virtual Machine

  • Conference paper
  • First Online:
Principles of Declarative Programming (ALP 1998, PLILP 1998)

Abstract

This paper shows how lazy functional programs can be made mobile by compiling them for the Java Virtual Machine. The Haskell compiler it describes is based on the 〈Ν,G〉-machine, which is designed for implementing lazy functional languages on parallel processors. Although this is not the obvious thing to do, it leads to a particularly elegant set of translation rules. Sadly though, the speed of the resulting Java Virtual Machine code programs is disappointing due to the surprisingly high cost of memory allocation/reclamation in current implementations of the Java Virtual Machine. In future work, we intend to find out whether this high cost is a property of the Java Virtual Machine's design or its implementation.

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. K. Arnold and J. Gosling. The Java Programming Language. Addison-Wesley, May 1996.

    Google Scholar 

  2. L. Augustsson and T. Johnsson. Parallel Graph Reduction with the 〈Ν,g〉machine. In Proceedings of the 1989 Conference on Functional Programming Languages and Computer Architecture, pages 202–213. ACM Press, 1989.

    Google Scholar 

  3. D. Colnet and S. Collin. SmallEiffel: the GNU Eiffel Compiler, April 1998.

    Google Scholar 

  4. T. Johnsson. Efficient Compilation of Lazy Evaluation. In Proceedings of the SIGPLAN'84 Symposium on Compiler Construction, pages 58–69, June 1984.

    Google Scholar 

  5. R. Jones. Tail Recursion Without Space Leaks. Journal of Functional Programming, 2(1):73–79, January 1992.

    Article  MATH  Google Scholar 

  6. T. Lindholm and F. Yellin. The Java Virtual Machine. Addison-Wesley, September 1996.

    Google Scholar 

  7. G. Meehan and M. Joy. Compiling Lazy Functional Programs to Java Bytecode. Technical report, Department of Computer Science, University of Warwick, May 1998. submitted for publication.

    Google Scholar 

  8. W. Partain. The nofib benchmark suite of Haskell programs. In Proceedings of the 1992 Glasgow Workshop on Functional Programming, pages 195–202. Springer-Verlag, 1992.

    Google Scholar 

  9. S. L. Peyton Jones. The Implementation of Functional Programming Languages. Prentice-Hall, 1987.

    Google Scholar 

  10. J. Peterson and K. Hammond, editors. Haskell 1.4: A Non-strict, Purely Functional Language. The Haskell Committee, April 1997.

    Google Scholar 

  11. G. L. Steele. Rabbit: A Compiler for Scheme. Technical Report AI-TR-474, MIT Laboratory for Computer Science, 1978.

    Google Scholar 

  12. S. Tucker Taft. Programming the Internet in Ada95. In Ada Europe Conference, June 1996.

    Google Scholar 

  13. T. Thorn. Programming Languages for Mobile Code. ACM Computing Surveys, 29(3):213–239, September 1997.

    Article  Google Scholar 

  14. M. Tullsen. 690 Project: Compiling Haskell to Java, September 1997.

    Google Scholar 

  15. D. Wakeling. A Haskell to Java Virtual Machine Code Compiler. In Draft Proceedings of the 1997 Workshop on the Implementation of Functional Languages, pages 71–84, September 1997.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Catuscia Palamidessi Hugh Glaser Karl Meinke

Rights and permissions

Reprints and permissions

Copyright information

Š 1998 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Wakeling, D. (1998). Mobile Haskell: Compiling lazy functional programs for the Java Virtual Machine. In: Palamidessi, C., Glaser, H., Meinke, K. (eds) Principles of Declarative Programming. ALP PLILP 1998 1998. Lecture Notes in Computer Science, vol 1490. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0056624

Download citation

  • DOI: https://doi.org/10.1007/BFb0056624

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-65012-6

  • Online ISBN: 978-3-540-49766-0

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics