I sent this message out a few days ago, but never saw it show up on the
list... Just to recap....

a) option #1 seemed best to me
b) this will all happen at the parrot level
c) languages will almost never "change" an object to read-only
d) there are some reasons that old access to an object should not
"become" read-only
e) true read-onlyness will probably most often be optimized at the
language level by storing cached values in typed registers anyway

-- 
Aaron Sherman <[EMAIL PROTECTED]>
Senior Systems Engineer and Perl Toolsmith
http://www.ajs.com/~ajs/resume.html

--- Begin Message ---
On Sat, 2004-05-29 at 15:29, Dan Sugalski wrote:

> The problem with the first scheme is that anything that has a handle 
> on the PMC will not get the new layers. Not a good thing.

I like the first scheme. The question that comes up is: when does
something get layered?

That is: if I have code that says:

        new_thread_increment_every_minute(foo)
        become_read_only(foo)

Then, you have two choices of semantic:

1. foo is read-only retroactively and will throw an exception in one
minute
2. You've given the new thread a read-write version of foo, and the
read-only version created after that now has the property of changing
every minute.

I would see this as being very useful for several types of read-only
access to data that DOES change (an accumulator for a random number
entropy pool, for example).

High level languages on the other hand, should probably not expose this
directly. They will create a variable and tag it as read only at the
same time, and to the programmer there's no difference.

If they do allow for run-time read-only-ification, they can always build
their own high-level abstraction around this core PMC.

The only problem I see with this is that high level languages might want
to cache the value of a read-only variable in a typed register. If read
only really is read only, that's valid, but if it's only an interface
restriction it's not.

There you're going to have some semantic boundaries between languages
that might be unfortunate. How much of a problem that is, I'm not sure.

As for threading, I think the simple layering is easiest, and again, you
create the PMC layered if you want that functionality (e.g. for
locking).

-- 
Aaron Sherman <[EMAIL PROTECTED]>
Senior Systems Engineer and Toolsmith
"It's the sound of a satellite saying, 'get me down!'" -Shriekback


--- End Message ---

Reply via email to