[Vm-dev] Re: Immutability, newspeak (was: Vm-dev post from jbaptiste.arnaud@gmail.com requires approval)

Igor Stasenko siguctua at gmail.com
Wed Jun 9 19:34:18 UTC 2010


On 9 June 2010 21:51, Andreas Raab <andreas.raab at gmx.de> wrote:
>
> On 6/8/2010 7:41 AM, David T. Lewis wrote:
>>
>> What do the VM developers think with respect adopting the VM changes?
>> The immutability bit is a scarce resource. Is it OK to allocate it
>> for this purpose or are there likely to be other projects interested
>> in using it for other reasons?
>
> Oh, and one thing that I'm just realizing is that by far the biggest impact
> of immutability is in primitives and plugins. All primitives in all plugins
> must be rewritten to test for mutability of the objects they store into
> before this can work reliably. Ouch.
>

Yeah. I told before, that i'm not a big fan of making VM more and more clever.
It is because 'clever' is synonym to 'complexity'.

I'd rather focus on providing immutability at language side, instead
of implementing it
primitively.

However, i am thinking, if there could be good alternatives to
immutability bit in object header.
One idea is to add this bit on a per-class basis, not on a per-instance basis.

Then VM could check immutability during a method lookup and throw
exception before entering method(s) which can mutate
an instance of such class. But then we should also divide
primitives/methods on those which can and can't
mutate the object's state, which is also a lot of work.

Checking before entering method potentially will have much less impact
on performance, because it is not so fine granular as per each write.

> Cheers,
>  - Andreas
>



-- 
Best regards,
Igor Stasenko AKA sig.


More information about the Vm-dev mailing list