Escape analysis
Robert Jacques
sandford at jhu.edu
Tue Oct 28 20:52:04 PDT 2008
I've run across some academic work on ownership types which seems relevant
to this discussion on share/local/scope/noscope.
Paper: http://www.cs.jhu.edu/~scott/pll/papers/pedigree-types.pdf
Slides: http://www.cs.jhu.edu/~scott/pll/papers/iwaco.ppt
Site: http://www.cs.jhu.edu/~scott/pll/abinitio.html
Overview:
Pedigree Types are an intuitive ownership type system requiring minimal
programmer annotations. Reusing the vocabulary of human genealogy,
Pedigree Types programmers can qualify any object reference with a
pedigree -- a child, sibling, parent, grandparent, etc -- to indicate what
relationship the object being referred to has with the referant on the
standard ownership tree, following the owners-as-dominators convention.
Such a qualifier serves as a heap shape constraint that must hold at run
time and is enforced statically. Pedigree child captures the intention of
encapsulation, i.e. ownership: the modified object reference is ensured
not to escape the boundary of its parent. Among existing ownership type
systems, Pedigree Types are closest to Universe Types. The former can be
viewed as extending the latter with a more general form of pedigree
modifiers, so that the relationship between any pair of objects on the
aforementioned ownership tree can be named and -- more importantly --
inferred. We use a constraint-based type system which is proved sound via
subject reduction. Other technical originalities include a polymorphic
treatment of pedigrees not explicitly specified by programmers, and use of
linear diophantine equations in type constraints to enforce the hierarchy.
More information about the Digitalmars-d
mailing list