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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
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.
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.
R.J.M. Hughes. The Design and Implementation of Programming Languages. PhD thesis, Oxford University, 1984.
R.J.M. Hughes. Parallel Functional Languages use Less Space. In Symposium on Lisp and Functional Programming, Austin, Texas, 1984.
M. Jones. The Implementation of the Gofer Functional Programming System. Research Report YALEU/DCS/RR-1030, Yale University, May 1994.
R.E. Jones. Tail Recursion Without Space Leaks. Journal of Functional Programming, 2(1):73–79, January 1992.
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.
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.
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.
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.
A. Reid. Handling Exceptions in Haskell. Research Report YALEU/DCS/RR-1175, Yale University, Department of Computer Science, August 1998.
C. Runciman and D. Wakeling. Heap Profiling of Lazy Functional Programs. Journal of Functional Programming, 3(2):217–246, April 1993.
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.
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
P.L. Wadler. Fixing a Space Leak With a Garbage Collector. Software — Practice and Experience, 17(9):595–608, 1987.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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