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

  • Authors:
  • Alastair Reid

  • Affiliations:
  • -

  • Venue:
  • IFL '98 Selected Papers from the 10th International Workshop on 10th International Workshop
  • Year:
  • 1998

Quantified Score

Hi-index 0.00

Visualization

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.