LFP '90 Proceedings of the 1990 ACM conference on LISP and functional programming
Tag-free garbage collection using explicit type parameters
LFP '94 Proceedings of the 1994 ACM conference on LISP and functional programming
A syntactic approach to type soundness
Information and Computation
Abstract models of memory management
FPCA '95 Proceedings of the seventh international conference on Functional programming languages and computer architecture
Ephemerons: a new finalization mechanism
Proceedings of the 12th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications
Semantics of memory management for polymorphic languages
Higher order operational techniques in semantics
Stretching the Storage Manager: Weak Pointers and Stable Names in Haskell
IFL '99 Selected Papers from the 11th International Workshop on Implementation of Functional Languages
A calculus for java's reference objects
ACM SIGPLAN Notices
Hi-index | 0.00 |
Weak references are references that do not prevent the object they point to from being garbage collected. Many realistic languages, including Java, SML/NJ, and Haskell to name a few, support weak references. However, there is no generally accepted formal semantics for weak references. Without such a formal semantics it becomes impossible to formally prove properties of such a language and the programs written in it.We give a formal semantics for a calculus called λweak that includes weak references and is derived from Morrisett, Felleisen, and Harper's λgc. The semantics is used to examine several issues involving weak references. We use the framework to formalize the semantics for the key/value weak references found in Haskell. Furthermore, we consider a type system for the language and show how to extend the earlier result that type inference can be used to collect reachable garbage. In addition we show how to allow collection of weakly referenced garbage without incurring the computational overhead often associated with collecting a weak reference which may be later used. Lastly, we address the non-determinism of the semantics by providing both an effectively decidable syntactic restriction and a more general semantic criterion, which guarantee a unique result of evaluation.