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

Eliot Miranda eliot.miranda at gmail.com
Wed Jun 9 20:14:35 UTC 2010

Hi Igor,

On Wed, Jun 9, 2010 at 12:54 PM, Igor Stasenko <siguctua at gmail.com> wrote:

> On 9 June 2010 22:30, Eliot Miranda <eliot.miranda at gmail.com> wrote:
> >
> >
> >
> > On Wed, Jun 9, 2010 at 11:51 AM, 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.
> >
> > Ouch indeed.  One can at least put a check in interpreterProxy to catch
> attempts and cause primitives to fail.  It won't be pretty but will serve as
> lint for the plugins.
> > Off the top of your head which plugins are likely to do writes?
> There is a good primitives and bad ones.
> A good ones, which use writes only to receiver. A bad ones, is those,
> which doing writes to other objects (arguments/indirectly fetched
> objects).
> With good ones we could deal very easily, by simply modifying a code
> generator to generate a write-check at the beginning of primitive. But
> there is no way to deal automatically with bad ones :(
> > And which of those are likely to do writes to immutables?
> well, if we introduce a per-object immutability flag, then any of them
> could eventually write to immutable object, isnt?

This really isn't helpful.  I asked a specific question, not a general
encouragement for FUD.  In my looking at plugins I see a few that create new
objects, mutate these (obviously not an issue) and return results.  I see
others that get passed in containers in which to receive results.  These
latter ones need to be changed, not the former.  But I don't see that many
of them.  One of the problems here is that the containers can often be
written into by first asking the interpreterProxy for firstIndexableField:
or firstFixedField: and then writing through the pointer which would
circumvent any attempt by the interpreterProxy to enforce immutability.  But
how common are these and how difficult would it be to scan for them?  There
are certainly plenty of senders in my image.


> >>
> >> Cheers,
> >>  - Andreas
> >
> >
> >
> --
> Best regards,
> Igor Stasenko AKA sig.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20100609/9d1ed0d5/attachment.htm

More information about the Vm-dev mailing list