Stretching the storage manager: weak pointers and stable names in Haskell

Simon Peyton Jones, Simon Marlow, and Conal Elliot

Abstract

Every now and then, a user of the Glasgow Haskell Compiler asks for a feature that requires specialised support from the storage manager. Memo functions, pointer equality, external pointers, finalizers, and weak pointers, are all examples. We take memo functions as our exemplar because they turn out to be the trickiest to support. We present no fewer than four distinct mechanisms that are needed to support memo tables, and that (in various combinations) satisfy a variety of other needs. The resulting set of primitives is undoubtedly powerful and useful. Whether they are too powerful is not yet clear. While the focus of our discussion is on Haskell, there is nothing Haskell-specific about most of the primitives, which could readily be used in other settings.

Details

Publication typeInproceedings
Published inProceedings of the 11th International Workshop on the Implementation of Functional Languages
URLhttp://www.haskell.org/~simonmar/papers/weak.pdf
SeriesLNCS
PublisherSpringer-Verlag
> Publications > Stretching the storage manager: weak pointers and stable names in Haskell