<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On 17.01.2010, at 02:23, Eliot Miranda wrote:</div><blockquote type="cite"><div class="gmail_quote">On Sat, Jan 16, 2010 at 11:20 AM, David T. Lewis <span dir="ltr">&lt;<a href="mailto:lewis@mail.msen.com">lewis@mail.msen.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
The issue is now on Mantis:<br>
<br>
 &nbsp;<a href="http://bugs.squeak.org/view.php?id=7454" target="_blank">http://bugs.squeak.org/view.php?id=7454</a><br>
<br>
Moving the closure primitives would be difficult at this point, as<br>
we have a large installed base of closure-enabled images by now.<br>
<br>
In principle, it should be possible to update the primitiveTable at<br>
run time based on imageFormatVersion, or perhaps as an option to be<br>
supplied to the VM at startup time, or a combination of the two.<br>
<br>
Doing it automatically based on imageFormatVersion would probably<br>
work, but has a catch-22 for someone adding closures to an older<br>
image (e.g. adding the closure support to Etoys). For that situation<br>
you want to be able to turn on closure support even though the image<br>
does not yet need them, so perhaps e.g. a "-closures" command line<br>
option turn on closure support in that case.<br>
<br>
Any other ideas?<br></blockquote><div class="gmail_quote"><br></div>Would it be possible to write a script to replace the numbered primitives in the Scratch image with named prims and run that script on a suitable pre-closure VM? &nbsp;Once the image is saved it should run on the closure-enabled VMs.<div>
<br></div><div>Surely this is better than rewriting the primitive table. &nbsp;I would think we would want to move away from obsolete interfaces and if Scratch supports named prims then it works, is compatible with other Squeaks and avoids hacks.</div></div></blockquote><div><br></div><div>The Scratch image is from around Squeak 2.5 - you might take a look here:</div><div><a href="http://download.scratch.mit.edu/source-code/ScratchSource1.4.zip">http://download.scratch.mit.edu/source-code/ScratchSource1.4.zip</a></div><div><br></div><div>- Bert -</div><br><blockquote type="cite"><div class="gmail_quote">
<div>&nbsp;</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Dave<br>
<div><div></div><div class="h5"><br>
On Sat, Jan 16, 2010 at 06:56:47PM +0100, Bert Freudenberg wrote:<br>
&gt;<br>
&gt; Fwd from John Maloney ...<br>
&gt;<br>
&gt; - Bert -<br>
&gt;<br>
&gt; Begin forwarded message:<br>
&gt; &gt;<br>
&gt; &gt; From: John Maloney &lt;<a href="mailto:jmaloney@media.mit.edu">jmaloney@media.mit.edu</a>&gt;<br>
&gt; &gt; Date: 16. Januar 2010 16:21:59 MEZ<br>
&gt; &gt; To: Bert Freudenberg &lt;<a href="mailto:bert@freudenbergs.de">bert@freudenbergs.de</a>&gt;<br>
&gt; &gt; Cc: Ian Piumarta &lt;<a href="mailto:ian@vpri.org">ian@vpri.org</a>&gt;<br>
&gt; &gt; Subject: Re: [Vm-dev] Re: [squeak-dev] Numbered primitives in images<br>
&gt; &gt;<br>
&gt; &gt; Hi, Bert.<br>
&gt; &gt;<br>
&gt; &gt; Thanks for the alert.<br>
&gt; &gt;<br>
&gt; &gt; Yep, this would be a problem for Scratch. It would prevent sharing projects on the website. Normally, I would not mind sticking with an older VM, but that there is also a change in the sound support on Linux from ALSA to Pulse Audio that we need, and work on that is still ongoing. So we may need to use a current VM, at least on Linux.<br>

&gt; &gt;<br>
&gt; &gt; Any chance there are some other numbered primitives that could be co-opted for the closure prims? As I recall there were lots of unused numbered primitives.<br>
&gt; &gt;<br>
&gt; &gt; &nbsp; &nbsp; -- John<br>
&gt; &gt;<br>
&gt; &gt; On Jan 16, 2010, at 9:57 AM, Bert Freudenberg wrote:<br>
&gt; &gt;&gt; That may be a problem ...<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; - Bert -<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; Begin forwarded message:<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt; From: "David T. Lewis" &lt;<a href="mailto:lewis@mail.msen.com">lewis@mail.msen.com</a>&gt;<br>
&gt; &gt;&gt;&gt; Date: 16. Januar 2010 15:55:02 MEZ<br>
&gt; &gt;&gt;&gt; To: "K. K. Subramaniam" &lt;<a href="mailto:subbukk@gmail.com">subbukk@gmail.com</a>&gt;<br>
&gt; &gt;&gt;&gt; Cc: <a href="mailto:vm-dev@lists.squeakfoundation.org">vm-dev@lists.squeakfoundation.org</a><br>
&gt; &gt;&gt;&gt; Subject: [Vm-dev] Re: [squeak-dev] Numbered primitives in images<br>
&gt; &gt;&gt;&gt; Reply-To: Squeak Virtual Machine Development Discussion &lt;<a href="mailto:vm-dev@lists.squeakfoundation.org">vm-dev@lists.squeakfoundation.org</a>&gt;<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt; On Sat, Jan 16, 2010 at 08:16:06AM +0530, K. K. Subramaniam wrote:<br>
&gt; &gt;&gt;&gt;&gt; On Friday 15 January 2010 10:46:45 pm Bert Freudenberg wrote:<br>
&gt; &gt;&gt;&gt;&gt;&gt; On 15.01.2010, at 16:58, K. K. Subramaniam wrote:<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt; Scratch 1.4 (Linux) of 30-Nov-2009 on 3.11-3 VM.<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt; Break into Scratch and do "Socket initializeNetwork".<br>
&gt; &gt;&gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt;&gt; So it does not occur in normal operation?<br>
&gt; &gt;&gt;&gt;&gt; Only if you define "normal" as "offline" ;-). Any operation which uses networking<br>
&gt; &gt;&gt;&gt;&gt; (url block) goes through this method and it will fail when run under the<br>
&gt; &gt;&gt;&gt;&gt; 3.11.3 VM built from unix-3.11.3-vmm or svn trunk.<br>
&gt; &gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt; BTW, Scratch image is just an example which has numbered primitives.<br>
&gt; &gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt; The 3.10-4 VM has primitiveObsoleteIndexedPrimitive in slot 207 in<br>
&gt; &gt;&gt;&gt;&gt; platforms/unix/src/vm/interp.c while the 3.11.3 tar.gz and the trunk contain<br>
&gt; &gt;&gt;&gt;&gt; primitiveFail. The change crept in r1935 through vmm-dtl-126.<br>
&gt; &gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt; Is this intentional or an oversight?<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt; Sorry I was not able to reply earlier. The change was intentional,<br>
&gt; &gt;&gt;&gt; but the effect on Scratch was not.<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt; Some of the obsolete primitives had to be dropped when we added the<br>
&gt; &gt;&gt;&gt; block closure support. This happened in February 2009 (VMMaker-eem.114<br>
&gt; &gt;&gt;&gt; in the SqS/VMMaker). Specifically, we changed from this, which redirects<br>
&gt; &gt;&gt;&gt; the numbered primitives:<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "Networking Primitives (200-225) - NO LONGER INDEXED"<br>
&gt; &gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (200 225 primitiveObsoleteIndexedPrimitive)<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt; to this, which reallocates the numbers for closure support and for<br>
&gt; &gt;&gt;&gt; future COG integration:<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "new closure primitives (were Networking primitives)"<br>
&gt; &gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (200 primitiveClosureCopyWithCopiedValues)<br>
&gt; &gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (201 primitiveClosureValue) "value"<br>
&gt; &gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (202 primitiveClosureValue) "value:"<br>
&gt; &gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (203 primitiveClosureValue) "value:value:"<br>
&gt; &gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (204 primitiveClosureValue) "value:value:value:"<br>
&gt; &gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (205 primitiveClosureValue) "value:value:value:value:"<br>
&gt; &gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (206 primitiveClosureValueWithArgs) "valueWithArguments:"<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (207 209 primitiveFail) "reserved for Cog primitives"<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt; The obsolete primitive redirection had been in place for at least five<br>
&gt; &gt;&gt;&gt; years, so backward compatibility had been preserved for some time.<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt; Question for Subbu: Is this an important issue may affect a large number<br>
&gt; &gt;&gt;&gt; of Scratch users? In other words, are there kids trying to run Scratch,<br>
&gt; &gt;&gt;&gt; and their Scratch image stops working properly after Squeak gets updated<br>
&gt; &gt;&gt;&gt; to use a new VM?<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt; And a thought for the vm-dev list: I don't know if there might be a<br>
&gt; &gt;&gt;&gt; technical solution to this, but it might be possible to use a strategy<br>
&gt; &gt;&gt;&gt; in which the some of the old primitive lookups are preserved (at least<br>
&gt; &gt;&gt;&gt; for the range 207 through 225) if and only if the image format is<br>
&gt; &gt;&gt;&gt; pre-closures. Follow ups to this on vm-only.<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt; Dave<br>
&gt; &gt;<br>
&gt;<br>
</div></div></blockquote></div><br>
</blockquote></div><div><br></div><div><br class="Apple-interchange-newline">
</div>
<br></body></html>