Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to main content

Compiling Lazy Functional Programs Based on the Spineless Tagless G-machine for the Java Virtual Machine

  • Conference paper
  • First Online:
Functional and Logic Programming (FLOPS 2001)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 2024))

Included in the following conference series:

Abstract

A systematic method of compiling lazy functional programs based on the Spineless Tagless G-machine (STGM) is presented for the Java Virtual Machine (JVM). A new specification of the STGM, which consists of a compiler and a reduction machine, is presented; the compiler translates a program in the STG language, which is the source language for the STGM, into a program in an intermediate language called L-code, and our reduction machine reduces the L-code program into an answer. With our representation for the reduction machine by the Java language, an L-code program is translated into a Java program simulating the reduction machine.

The translated Java programs also run at a reasonable execution speed. Our experiment shows that execution times of translated benchmarks are competitive compared with those in a traditional Haskell interpreter, Hugs, particularly when Glasgow Haskell compiler’s STG-level optimizations are applied.

Acknowledgment

We thank anonymous referees for their many helpful comments. The first author also thanks Hyeon-Ah Moon for her encouragement. This work is supported by Advanced Information Technology Research Center.

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

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

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.

Similar content being viewed by others

References

  1. N. Benton and A. Kennedy. Interlanguage Working Without Tears: Blending SML with Java. In Proceedings of the 4th ACM SIGPLAN Conference on Functional Prgramming, pages 126–137, 1999.

    Google Scholar 

  2. N. Benton, A. Kennedy, and G. Russell. Compiling Standard ML to Java Bytecodes. In Proceedings of the 3rd ACM SIGPLAN Conference on Functional Prgramming, pages 129–140, 1998.

    Google Scholar 

  3. M. Campione and K. Walrath. The Java Tutorial (2nd Ed.). Addison Wesley, March 1998.

    Google Scholar 

  4. T. Lindholm and F. Yellin. The Java TM Virtual Machine Specification (2nd Ed.). Addison Wesley, 1999.

    Google Scholar 

  5. G. Meehan and M. Joy. Compiling Lazy Functional Programs to Java Bytecode. Software-Practice and Experience, 29(7):617–645, June 1999.

    Article  Google Scholar 

  6. S. L. Peyton Jones. A Java Back End for Glasgow Haskell Compiler. The Haskell Mailing List haskell@haskell.org (http://www.haskell.org/mailinglist.html), May 2000.

  7. S. L. Peyton Jones. Implementing Lazy Functional Languages on Stock Hardware: the Spineless Tagless G-machine. Journal of Functional Programming, 2(2):127–202, April 1992.

    Article  Google Scholar 

  8. S. L. Peyton Jones and A. L. M. Santos. A Transformation-based Optimiser for Haskell. Science of Computer Programming, 32(1-3):3–47, 1998.

    Article  Google Scholar 

  9. M. Tullsen. Compiling Haskell to Java. 690 Project, Yale University, September 1997.

    Google Scholar 

  10. A. Vernet. The Jaskell Project. A Diploma Project, Swiss Federal Institute of Technology, February 1998.

    Google Scholar 

  11. D. Wakeling. Compiling Lazy Functional Programs for the Java Virtual Machine. Journal of Functional Programming, 9(6):579–603, November 1999.

    Article  Google Scholar 

  12. M. Wand. Correctness of Procedure Representations in Higher-Order Assembly Language. In S. Brookes, editor, Proceedings Mathematical Foundations of Programming Semantics ’91, volume 598 of Lecture Notes in Computer Science, pages 294–311. Springer Verlag, 1992.

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2001 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Choi, K., Lim, Hi., Han, T. (2001). Compiling Lazy Functional Programs Based on the Spineless Tagless G-machine for the Java Virtual Machine. In: Kuchen, H., Ueda, K. (eds) Functional and Logic Programming. FLOPS 2001. Lecture Notes in Computer Science, vol 2024. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-44716-4_6

Download citation

  • DOI: https://doi.org/10.1007/3-540-44716-4_6

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-41739-2

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

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics