Advertisement

Stretching the Storage Manager: Weak Pointers and Stable Names in Haskell

  • Simon Peyton Jones
  • Simon Marlow
  • Conal Elliott
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1868)

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.

Keywords

Weak Pointer Hash Table Pointer Equality Stable Pointer Garbage Collection 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Cook, B., Launchbury, J.: Disposable memo functions. In: Proceedings of the 1997 Haskell Workshop (1997)Google Scholar
  2. 2.
    Dybvig, R., Bruggeman, C., Elby, D.: Guardians in a generation-based garbage collector. In: SIGPLAN Symposium on Programming Language Design and Implementation (PLDI 1993), Albuquerque, pp. 207–216 (June 1993)Google Scholar
  3. 3.
    Hayes, B.: Finalization in the collector interface. In: Bekkers, Y., Cohen, J. (eds.) IWMM-GIAE 1992. LNCS, vol. 637, pp. 277–298. Springer, Heidelberg (1992)CrossRefGoogle Scholar
  4. 4.
    Hayes, B.: Ephemerons: a new finalization mechanism. In: Proceedings ACM Con- ference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA 1997), pp. 176–183. ACM, New York (1997)CrossRefGoogle Scholar
  5. 5.
    Hughes, R.: Lazy memo-functions. In: Proc. Aspenas workshop on implementation of functional languages (February 1985)Google Scholar
  6. 6.
    Java Software, Sun Microsystems, Inc., Java Development Kit 1.2 Documentation, http://java.sun.com/docs/
  7. 7.
    Keller, R., Sleep, M.: Applicative caching. ACM Transactions on Programming Languages and Systems 8, 88–108 (1986)zbMATHCrossRefGoogle Scholar
  8. 8.
    Lester, D.: An efficient distributed garbage-collection algorithm. In: Odijk, E., Syre, J.-C., Rem, M. (eds.) PARLE 1989. LNCS, vol. 365, pp. 207–223. Springer, Heidelberg (1989)Google Scholar
  9. 9.
    Peyton Jones, S.L., Gordon, A.J., Finne, S.O.: Concurrent Haskell. In: 23rd ACM Symposium on Principles of Programming Languages, St. Petersburg Beach, Florida, pp. 295–308. ACM, New York (1996)Google Scholar
  10. 10.
    Peyton Jones, S.L., Wadler, P.L.: Imperative functional programming. In: 20th ACM Symposium on Principles of Programming Languages (POPL 1993), Charleston, pp. 71–84. ACM, New York (1993)CrossRefGoogle Scholar
  11. 11.
    Trinder, P., Hammond, K., Mattson, J., Partridge, A., Jones, S.P.: GUM: a portable parallel implementation of Haskell. In: SIGPLAN Symposium on Programming Language Design and Implementation (PLDI 1996), Philadelphia. ACM, New York (1996)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2000

Authors and Affiliations

  • Simon Peyton Jones
    • 1
  • Simon Marlow
    • 1
  • Conal Elliott
    • 2
  1. 1.Microsoft ResearchCambridge
  2. 2.Microsoft ResearchRedmond

Personalised recommendations