Skip to main content

Putting the Spine Back in the Spineless Tagless G-Machine: An Implementation of Resumable Black-Holes

  • Conference paper
  • First Online:
Implementation of Functional Languages (IFL 1998)

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

Included in the following conference series:

Abstract

Interrupt handling is a tricky business in lazy functional languages: we have to make sure that thunks that are being evaluated can be halted and later restarted if and when they are required. This is a particular problem for implementations which use black-holing. Black-Holing deliberately makes it impossible to revert such thunks to their original state to avoid a serious space leak. Interactive Haskell implementations such as Hugs and hbi catch interrupts and avoid the problem by omitting or disabling black-holing. Batch mode Haskell implementations such as HBC and the Glasgow Haskell Compiler (GHC) avoid this problem by disabling black-holing or by providing no way to catch interrupts. This paper describes a modification to GHC’s abstract machine (the Spineless Tagless G-Machine) which simultaneously supports both interrupts and black-holing.

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

Access this chapter

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.

References

  1. S. Breach, T.N. Vijaykumar, and G.S. Sohi. The Anatomy of the Register File in a Multiscalar Processor. In 27th. Annual International Symposium on Microarchitecture (MICRO-27), pages 181–190. ACM press, 1994.

    Google Scholar 

  2. M. Chakravarty. Lazy Thread and Task Creation in Parallel Graph-Reduction. In C. Clack, A. Davie, and K. Hammond, editors, Proc. 9th. International Workshop on the Implementation of Functional Languages (IFL’97), St Andrews, Scotland, September 1997, volume 1467 of LNCS, pages 231–249. Springer-Verlag, 1998.

    Google Scholar 

  3. R.J.M. Hughes. The Design and Implementation of Programming Languages. PhD thesis, Oxford University, 1984.

    Google Scholar 

  4. R.J.M. Hughes. Parallel Functional Languages use Less Space. In Symposium on Lisp and Functional Programming, Austin, Texas, 1984.

    Google Scholar 

  5. M. Jones. The Implementation of the Gofer Functional Programming System. Research Report YALEU/DCS/RR-1030, Yale University, May 1994.

    Google Scholar 

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

    Article  MATH  Google Scholar 

  7. J.S. Mattson Jr. and W.G. Griswold. Speculative Evaluation for Parallel Graph Reduction. In Parallel Architectures and Compilation Techniques (PACT’94), pages 331–334. North-Holland, August 1994.

    Google Scholar 

  8. 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.

    MATH  Google Scholar 

  9. S.L. Peyton Jones, A.D. Gordon, and S.O. Finne. Concurrent Haskell. In Proc. 23rd. ACM Symposium on Principles of Programming Languages (POPL’96), pages 295–308, St Petersburg Beach, Florida, January 1996. ACM Press.

    Chapter  Google Scholar 

  10. S.L. Peyton Jones, A. Reid, A. Hoare, S. Marlow, and F. Henderson. A Semantics for Imprecise Exceptions. In Proc. 1999 ACM Conference on Programming Language Design and Implementation (PLDI’99), To Appear, May 1999.

    Google Scholar 

  11. A. Reid. Handling Exceptions in Haskell. Research Report YALEU/DCS/RR-1175, Yale University, Department of Computer Science, August 1998.

    Google Scholar 

  12. C. Runciman and D. Wakeling. Heap Profiling of Lazy Functional Programs. Journal of Functional Programming, 3(2):217–246, April 1993.

    Google Scholar 

  13. J. Sparud. Fixing Some Space Leaks Without a Garbage Collector. In Proc. 1993 ACM Conference on Functional Programming Languages and Computer Architecture (FPLCA’93), 1993.

    Google Scholar 

  14. P.W. Trinder, K. Hammond, J.S. Mattson Jr., A.S. Partridge, and S.L. Peyton Jones. GUM: a Portable Parallel Implementation of Haskell. In Proc. 1996 ACM Conference on Programming Language Design and Implementation (PLDI’96), Philadelphia, pages 78–88, May 1996

    Google Scholar 

  15. P.L. Wadler. Fixing a Space Leak With a Garbage Collector. Software — Practice and Experience, 17(9):595–608, 1987.

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 1999 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Reid, A. (1999). Putting the Spine Back in the Spineless Tagless G-Machine: An Implementation of Resumable Black-Holes. In: Hammond, K., Davie, T., Clack, C. (eds) Implementation of Functional Languages. IFL 1998. Lecture Notes in Computer Science, vol 1595. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-48515-5_12

Download citation

  • DOI: https://doi.org/10.1007/3-540-48515-5_12

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-66229-7

  • Online ISBN: 978-3-540-48515-5

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics