Immutability bit? Eliot?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Immutability bit? Eliot?

Göran Krampe
 
Hi VM gurus!

I just responded to a persistence thread on the seaside-list and it
occurred to me that I should ask you guys - especially Eliot I guess -
will the new VM have support for detecting object modification?

...and oh, when do we get the new awesome VM? I am doing reload on
mirandabanda every day but no luck so far... :) :)

Cees de Groot explained a technique (a long while back) using an
immutability bit on objects - combined with some Exception being
signalled when an immutable object is about to be modified. This way you
get both support for immutable objects AND "dirty marking" because you
can always catch the Exception, add the object as "dirty" in a pool, and
then resume.

Especially for all the persistence solutions out there this would be
great to have - and would eliminate trickery like WriteBarrier:

http://map.squeak.org/packagebyname/writebarrier

regards, Göran

Reply | Threaded
Open this post in threaded view
|

Re: Immutability bit? Eliot?

Eliot Miranda-2
 
Hi Goran,

2009/5/26 Göran Krampe <[hidden email]>

Hi VM gurus!

I just responded to a persistence thread on the seaside-list and it occurred to me that I should ask you guys - especially Eliot I guess - will the new VM have support for detecting object modification?

The immutability bit is already available in the Newspeak VM (http://newspeaklanguage.org/downloads/).  This VM doesn't have the closure bytecodes and the immutability bit is not in the current closure VMs, so there is an integration step required.

The real step however is some way of conveniently making the immutability bit optional.  When I figure this out I can do the integration step, do some performance comparisons and then ask the community if they'd like the feature in the standard VM.

...and oh, when do we get the new awesome VM? I am doing reload on mirandabanda every day but no luck so far... :) :)

The stack VM should be available very soon.  The JIT VM will be available later in the year.
 
Cees de Groot explained a technique (a long while back) using an immutability bit on objects - combined with some Exception being signalled when an immutable object is about to be modified. This way you get both support for immutable objects AND "dirty marking" because you can always catch the Exception, add the object as "dirty" in a pool, and then resume.

Especially for all the persistence solutions out there this would be great to have - and would eliminate trickery like WriteBarrier:

http://map.squeak.org/packagebyname/writebarrier

Right.  VisualAge was the first Smalltalk I know of to use an immutable bit, and GemStone used it there.  I added this to VisualWorks along with the necessary exception support and now GemStone uses the bit on VW too.  The work I did for Newspeak was very similar to the VisualWorks scheme.  If you download the Newspeak system you can experiment with the immutablity scheme there-in.



regards, Göran