chromatic wrote:
On Sunday 24 February 2008 18:41:23 Bob Rogers wrote:
Granted, and it's tough to make a PMC truly read-only until after it's
completely initialized . . .
There's a similar problem for accessors and setters. Again, that's
solveable with more code or more cleverness.
So, you're saying it is legal to invoke a setter on a constant PObj? In
what sense then is that PObj a constant?
That depends. Is a hash declared with:
.const Hash foo
.. constant as a reference or a referent or an aggregate or some combination
of all three?
.const PMCs are value constants. Their values can only be set in the
declaration, and can't be changed later. Constant aggregates can only
contain other constants. In PIR, at the moment, there is no way to
create a constant aggregate anyway, because .const only accepts a single
value.
Any time you talk about setting the value of a constant later, you're
not really talking about constants, you're talking about some
half-constant optimization. We're better off keeping constants as pure
constants and pushing everything else to standard GC.
Allison's GC spec uses in incremental mark scheme with tri-coloring. I'm sort
of hopeful we can get at least to a copying scheme for the sweep.
Long-term that's what I want too, but I won't require it for the 1.0
release. The advantages of a copying/compacting garbage collector won't
really be noticed until we're running large production systems. Call it
a goal for 1.5.
Allison