<div dir="ltr"><br><br><div class="gmail_quote">On Tue, Jul 29, 2008 at 1:03 PM, Janko Mivšek <span dir="ltr">&lt;<a href="mailto:janko.mivsek@eranova.si">janko.mivsek@eranova.si</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi Eliot,<br>
<br>
Does that mean that you are introducing immutability in new Squeak VM you are working on? Well, that would be really nice!<br></blockquote><div><br></div><div><br></div><div><br></div><div>I think that&#39;s up to the community. &nbsp;There is a small performance hit (don&#39;t have measurements to hand but would expect it to be in the 2% to 4% range). &nbsp;What I&#39;d like to do is modify Slang so that one can mix and match components to produce the VM you want. &nbsp;In the StackVM I&#39;m working on I already have the ability to add a subclass that overrides methods in the superclass so NewObjectMemory organizes the young generation differently to ObjectMemory overriding a few methods. &nbsp;It should be easy to extend this to allow e.g. ImmutabilityInterpreter to override Interpreter and add immutability without having to rewrite the entire Interpreter class.</div>
<div><br></div><div>Then we don&#39;t have to commit to immutablity. &nbsp;People can experiment with it and then try to persuade the community that its a good idea (I do think its a good idea).</div><div><br></div><div>BTW, immutability involves primitive error codes and I will be introducing primitive error codes, because the performance hit is essentially zero and there is no backward compatibility issue (strange but true :) ).</div>
<div><br></div><div>&nbsp;</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Janko<br>
<br>
Eliot Miranda wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
On Tue, Jul 29, 2008 at 9:21 AM, stephane ducasse &lt;<a href="mailto:stephane.ducasse@free.fr" target="_blank">stephane.ducasse@free.fr</a> &lt;mailto:<a href="mailto:stephane.ducasse@free.fr" target="_blank">stephane.ducasse@free.fr</a>&gt;&gt; wrote:<br>

<br>
 &nbsp; &nbsp;Hello<br>
<br>
 &nbsp; &nbsp;I&#39;m reading newspeak spec and I like the idea of immutable strings.<br>
 &nbsp; &nbsp;Now what does it really bring to us?<br>
<br>
<br>
Safety. &nbsp;One can no longer overwrite literals or methods (or anything else whose state you want to protect) accidentally.<br>
<br>
Expressive power. &nbsp;One can use immutability as a write barrier in orthogonal persistence or distribution schemes (and other things) . &nbsp;One marks an object as immutable to indicate that it is persistent or distributed and its changes should be exported. &nbsp;The immutability scheme allows one to associate managers for specific objects that handle NoModificationErrors on a per-object basis. &nbsp;So if an object is immutable and has an appropriate manager that manager can temporarily enable immutablity for the object, allow the modification, communicate the modification (e.g. to a database or remote image) and then re-enable immutability. &nbsp;The framework allows an object to have multiple managers. &nbsp;(This is all standard Squeak and very similar to the code I wrote for VW. &nbsp;The VM code is also available from Cadence).<br>

<br>
 &nbsp; &nbsp;Then does it mean that we could get rid of symbols<br>
 &nbsp; &nbsp;immutability does not imply unique identity.<br>
<br>
<br>
No. &nbsp;As you point out Symbols are unique and so immutable strings don&#39;t replace them. &nbsp;But it is nice to have immutable Symbols. &nbsp;e.g. try to do this in your Squeak image:<br>
 &nbsp; &nbsp;#class pvtAt: 1 put: 0 asCharacter<br>
Scary :)<br>
<br>
<br>
<br>
 &nbsp; &nbsp;Stef<br>
<br>
<br>
<br>
------------------------------------------------------------------------<br>
<br>
<br>
</blockquote>
<br>
-- <br>
Janko Mivšek<br>
AIDA/Web<br>
Smalltalk Web Application Server<br>
<a href="http://www.aidaweb.si" target="_blank">http://www.aidaweb.si</a><br>
<br>
</blockquote></div><br></div>