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.
Preview
Unable to display preview. Download preview PDF.
References
K. Arnold and J. Gosling. The Java Programming Language. Addison-Wesley, May 1996.
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.
D. Colnet and S. Collin. SmallEiffel: the GNU Eiffel Compiler, April 1998.
T. Johnsson. Efficient Compilation of Lazy Evaluation. In Proceedings of the SIGPLAN'84 Symposium on Compiler Construction, pages 58â69, June 1984.
R. Jones. Tail Recursion Without Space Leaks. Journal of Functional Programming, 2(1):73â79, January 1992.
T. Lindholm and F. Yellin. The Java Virtual Machine. Addison-Wesley, September 1996.
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.
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.
S. L. Peyton Jones. The Implementation of Functional Programming Languages. Prentice-Hall, 1987.
J. Peterson and K. Hammond, editors. Haskell 1.4: A Non-strict, Purely Functional Language. The Haskell Committee, April 1997.
G. L. Steele. Rabbit: A Compiler for Scheme. Technical Report AI-TR-474, MIT Laboratory for Computer Science, 1978.
S. Tucker Taft. Programming the Internet in Ada95. In Ada Europe Conference, June 1996.
T. Thorn. Programming Languages for Mobile Code. ACM Computing Surveys, 29(3):213â239, September 1997.
M. Tullsen. 690 Project: Compiling Haskell to Java, September 1997.
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.
Author information
Authors and Affiliations
Editor information
Rights 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