<br><br><div class="gmail_quote">On Thu, Jun 14, 2012 at 12:14 PM, Igor Stasenko <span dir="ltr">&lt;<a href="mailto:siguctua@gmail.com" target="_blank">siguctua@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><br>
On 14 June 2012 20:31, Colin Putney &lt;<a href="mailto:colin@wiresong.com">colin@wiresong.com</a>&gt; wrote:<br>
&gt;<br>
&gt; Igor wrote:<br>
&gt;<br>
&gt;&gt; In theory, of course we can enforce anything, but in practice that<br>
&gt;&gt; means a lot of complex code with many checks at VM side.. This is not<br>
&gt;&gt; what i like to see in a first place, especially knowing that Squeak<br>
&gt;&gt; lived well so far without any immutability and it does not feels like<br>
&gt;&gt; we miss it badly.<br>
&gt;<br>
&gt; Andreas responded:<br>
&gt;<br>
&gt;&gt; I absolutely do. There were several situations (for example in Croquet<br>
&gt;&gt; and at Teleplace) where we changed our designs to the worse merely due<br>
&gt;&gt; to the lack of immutability support. The main thing that immutability<br>
&gt;&gt; fixes is to prevent accidental modifications of objects thought to be<br>
&gt;&gt; immutable (method literals for example), which when they happen are<br>
&gt;&gt; *extremely* hard to find. But it also gives rise to many other<br>
&gt;&gt; interesting techniques (read-only transactions etc).<br>
&gt;<br>
&gt; I have to agree with Andreas here. I&#39;ve used immutability to good<br>
&gt; effect in VisualWorks, and run into several situations where I wanted<br>
&gt; it in Squeak and had to make do with a work around. Avi&#39;s WriteBarrier<br>
&gt; package is one of those workarounds.<br>
&gt;<br>
&gt; To be honest, I&#39;m a little puzzled by the resistance to immutability.<br>
<br>
</div>Well, my main take against it, that smalltalk lived quite well without<br>
it so far.<br></blockquote><div><br></div><div>But it *hasn&#39;t*, as evinced by the bugs in the base libraries surfaced by adding immutablity to VisualWorks (and no doubt to VisualAge as well).</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

If it would be so crucial, then it would be there long ago, (even back<br>
in ST&#39;80) isn&#39;t?<br></blockquote><div><br></div><div>On a 16-bit machine with 32k objects there were many things that were lived without.  Would you have us do without ensure: and exceptions and tuples and closures just because  Smalltalk-80 didn&#39;t have them?  What a silly argument.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
&gt;From a purist&#39;s perspective, it also doesn&#39;t looks like a good move.<br>
Because originally we start from quite simple and universal:<br>
- everything is an object<br>
then we added<br>
- all objects are instances of some class<br>
<br>
but now we adding:<br>
all objects  *also* have identity hash<br>
all objects *also* have immutability bit<br>
<br>
today we have few of those *also&#39;s* , tomorrow we will find the need<br>
for 50 more, because there&#39;s virtually<br>
no limit about what additional properties we may want to have per object..<br>
<br>
And so, an only logical step, as to me was to do it for real:<br>
I proposed to add a slot for arbitrary properties per object, is<br>
simply a unification of the above,<br>
so you can state:<br>
- all objects *also* have at least one property slot, which can be<br>
used by language to store arbitrary properties per object (or at least<br>
one), *without* a need from object in question to have a direct<br>
knowledge<br>
about the nature of these properties (in contrast to instance<br>
variables, immutability, hash etc).<br>
<br>
That also means that VM don&#39;t needs to know anything about those<br>
properties as well, which directly converts into less code and less<br>
complexity.<br>
<div class="im"><br>
<br>
&gt; It&#39;s not like this is a new idea with unclear semantics or unknown<br>
&gt; utility. The VisualWorks implementation is simple and useful.<br>
&gt; VisualWorks is still the fastest Smalltalk around, so the performance<br>
&gt; impact can&#39;t be *too* high. VisualWorks is fairly similar to Squeak,<br>
&gt; so it&#39;s not unreasonable to use it as a model for considering<br>
&gt; immutability in Squeak.<br>
&gt;<br>
&gt; Now, maybe there really are problems with the VW, VA or Gemstone<br>
&gt; implementations, and if so, let&#39;s hear about them. &quot;It&#39;s not<br>
&gt; necessary&quot; isn&#39;t a good argument, because nothing is really<br>
&gt; necessary—assembly works fine. What are the costs, benefits and<br>
&gt; trade-offs of VM-supported immutability?<br>
&gt;<br>
<br>
</div>For me the main cost is, of course, performance. If we take our<br>
existing images (which have no notion<br>
about immutability) they will perform slower on same hardware.<br>
We can turn this cons into pros, only when we will start using<br>
immutability around the places..<br>
and here is where fun stuff begins: you cannot manage immutability<br>
state over more than ONE framework.<br>
So you will have to invent more complex schemes like mentioned<br>
&quot;immutability managers&quot; etc..<br>
<br>
Anyways, the fact is, that most software will still won&#39;t use it<br>
anyways, but you will keep paying the price of having it.<br>
It&#39;s like introducing a new tax &quot;to fund an activities to keep<br>
homeowner&#39;s lawns green and clean&quot;, and taking it from everyone, even<br>
from those who don&#39;t have own lawn and even don&#39;t own the house :)<br>
<br>
<br>
&gt; Colin<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
--<br>
Best regards,<br>
Igor Stasenko.<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div><br>