<br><br><div class="gmail_quote">On Fri, May 11, 2012 at 6:46 AM, Bert Freudenberg <span dir="ltr">&lt;<a href="mailto:bert@freudenbergs.de" target="_blank">bert@freudenbergs.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I just checked. Most, if not all of the problems, come from Scratch&#39;s use of numbered primitives. They were deprecated in favor of named primitives.<br>
<br>
IMHO it would be reasonably simple to re-instate these primitives in the VM. Right now they are simply mapped to primitiveFail. This would get us back the ability to run many old images, unmodified.<br></blockquote><div>
<br></div><div>Alas I&#39;ve used a few of these for Cog:</div><div><br></div><div> #(#(161 #primitiveSetIdentityHash)</div><div>    #(169 #primitiveNotIdentical)</div><div>    #(175 #primitiveBehaviorHash)</div><div>    #(176 #primitiveMaxIdentityHash)</div>
<div>    #(185 #primitiveExitCriticalSection)</div><div>    #(213 #primitiveContextXray)</div><div>    #(214 #primitiveVoidVMState)</div><div>    #(215 #primitiveVoidVMStateForMethod)</div><div>    #(218 #primitiveDoNamedPrimitiveWithArgs)</div>
<div>    #(240 #primitiveUTCMicrosecondClock)</div><div>    #(241 #primitiveLocalMicrosecondClock)</div><div>    #(242 #primitiveSignalAtUTCMicroseconds)</div><div>    #(243 #primitiveUpdateTimezone))</div><div> </div><div>
I think your change set is the way to go.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
The fix for Scratch would be to change all the deprecated primitive calls in the image to the new ones. This is straightforward, though a bit tedious.<br>
<br>
Do we have a list of old primitive numbers and their corresponding new named equivalents?<br>
<br>
I came up with the following, executed in the Scratch image. Does it look reasonable? Executing the same in Etoys comes up empty, so I would assume these are the methods that need patching:<br>
<br>
Smalltalk allSelect: [:m | #((146 147) (150 159) (161 164) (169 185) (190 194) (207 209) (213 220) (223 229) (234 246) (520 569)) anySatisfy: [:i | m primitive between: i first and: i second]]<br>
<br>
a SortedCollection(<br>
&#39;ADPCMCodec privateDecodeMono:&#39;<br>
&#39;ADPCMCodec privateDecodeStereo:&#39;<br>
&#39;ADPCMCodec privateEncodeMono:&#39;<br>
&#39;ADPCMCodec privateEncodeStereo:&#39;<br>
&#39;Bitmap compress:toByteArray:&#39;<br>
&#39;Bitmap decompress:fromByteArray:at:&#39;<br>
&#39;FMSound mixSampleCount:into:startingAt:leftVol:rightVol:&#39;<br>
&#39;FileDirectory class primPathNameDelimiter&#39;<br>
&#39;FileDirectory primDeleteDirectory:&#39;<br>
&#39;FileDirectory primDeleteFileNamed:&#39;<br>
&#39;FileDirectory primLookupEntryIn:index:&#39;<br>
&#39;FileDirectory primRename:to:&#39;<br>
&#39;FileDirectory primSetMacFileNamed:type:creator:&#39;<br>
&#39;LoopedSampledSound mixSampleCount:into:startingAt:leftVol:rightVol:&#39;<br>
&#39;NetNameResolver class primNameResolverError&#39;<br>
&#39;NetNameResolver class primNameResolverStatus&#39;<br>
&#39;PluckedSound mixSampleCount:into:startingAt:leftVol:rightVol:&#39;<br>
&#39;ReverbSound applyReverbTo:startingAt:count:&#39;<br>
&#39;SampledSound class convert8bitSignedFrom:to16Bit:&#39;<br>
&#39;SampledSound mixSampleCount:into:startingAt:leftVol:rightVol:&#39;<br>
&#39;SerialPort primClosePort:&#39;<br>
&#39;SerialPort primOpenPort:baudRate:stopBitsType:parityType:dataBits:inFlowControlType:outFlowControlType:xOnByte:xOffByte:&#39;<br>
&#39;SerialPort primReadPort:into:startingAt:count:&#39;<br>
&#39;SerialPort primWritePort:from:startingAt:count:&#39;<br>
&#39;SimpleMIDIPort class primPortCount&#39;<br>
&#39;SimpleMIDIPort class primPortDirectionalityOf:&#39;<br>
&#39;SimpleMIDIPort class primPortNameOf:&#39;<br>
&#39;SimpleMIDIPort primMIDIClosePort:&#39;<br>
&#39;SimpleMIDIPort primMIDIOpenPort:readSemaIndex:interfaceClockRate:&#39;<br>
&#39;SimpleMIDIPort primMIDIReadPort:into:&#39;<br>
&#39;SimpleMIDIPort primMIDIWritePort:from:at:&#39;<br>
&#39;Socket primAcceptFrom:receiveBufferSize:sendBufSize:semaIndex:&#39;<br>
&#39;Socket primSocket:connectTo:port:&#39;<br>
&#39;Socket primSocket:listenOn:&#39;<br>
&#39;Socket primSocket:listenOn:backlogSize:&#39;<br>
&#39;Socket primSocket:sendData:startIndex:count:&#39;<br>
&#39;Socket primSocket:setPort:&#39;<br>
&#39;Socket primSocketAbortConnection:&#39;<br>
&#39;Socket primSocketCloseConnection:&#39;<br>
&#39;Socket primSocketCreateNetwork:type:receiveBufferSize:sendBufSize:semaIndex:&#39;<br>
&#39;Socket primSocketLocalAddress:&#39;<br>
&#39;Socket primSocketLocalPort:&#39;<br>
&#39;Socket primSocketRemoteAddress:&#39;<br>
&#39;Socket primSocketRemotePort:&#39;<br>
&#39;Socket primSocketSendDone:&#39;<br>
&#39;SoundPlayer class primSoundAvailableBytes&#39;<br>
&#39;SoundPlayer class primSoundPlaySamples:from:startingAt:&#39;<br>
&#39;SoundPlayer class primSoundStartBufferSize:rate:stereo:&#39;<br>
&#39;SoundPlayer class primSoundStartBufferSize:rate:stereo:semaIndex:&#39;<br>
&#39;SoundPlayer class primSoundStop&#39;<br>
&#39;SoundRecorder primGetActualRecordingSampleRate&#39;<br>
&#39;SoundRecorder primRecordSamplesInto:startingAt:&#39;<br>
&#39;SoundRecorder primSetRecordLevel:&#39;<br>
&#39;SoundRecorder primStartRecordingDesiredSampleRate:stereo:semaIndex:&#39;<br>
&#39;SoundRecorder primStopRecording&#39;<br>
&#39;StandardFileStream primAtEnd:&#39;<br>
&#39;StandardFileStream primClose:&#39;<br>
&#39;StandardFileStream primCloseNoError:&#39;<br>
&#39;StandardFileStream primGetPosition:&#39;<br>
&#39;StandardFileStream primOpen:writable:&#39;<br>
&#39;StandardFileStream primRead:into:startingAt:count:&#39;<br>
&#39;StandardFileStream primSetPosition:to:&#39;<br>
&#39;StandardFileStream primSize:&#39;<br>
&#39;StandardFileStream primSizeNoError:&#39;<br>
&#39;StandardFileStream primWrite:from:startingAt:count:&#39;<br>
&#39;String class findFirstInString:inSet:startingAt:&#39;<br>
&#39;String class indexOfAscii:inString:startingAt:&#39;<br>
&#39;String class translate:from:to:table:&#39;<br>
&#39;String compare:with:collated:&#39;<br>
&#39;String findSubstring:in:startingAt:matchTable:&#39;<br>
&#39;WarpBlt warpBitsSmoothing:sourceMap:&#39;)<br>
<span class="HOEnZb"><font color="#888888"><br>
- Bert -<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On 11.05.2012, at 02:06, David T. Lewis wrote:<br>
<br>
&gt;<br>
&gt; Hi Miriam,<br>
&gt;<br>
&gt; I think that your message did not reach the vm-dev mailing list, so I am<br>
&gt; CCing the list here. There has been some additional discussion on the list<br>
&gt; (list archive is at <a href="http://lists.squeakfoundation.org/pipermail/vm-dev/2012-May/date.html#start" target="_blank">http://lists.squeakfoundation.org/pipermail/vm-dev/2012-May/date.html#start</a><br>
&gt; and you can join the list at <a href="http://lists.squeakfoundation.org/mailman/listinfo/vm-dev" target="_blank">http://lists.squeakfoundation.org/mailman/listinfo/vm-dev</a>)<br>
&gt; that you may want to read, as you probably are not CCed on all of the postings.<br>
&gt;<br>
&gt; I am glad that you are working on the packaging for Debian, and for sure<br>
&gt; the VM developers and Scratch developers need to be responsible for solving<br>
&gt; problems in VMs and the Scratch image. The discussion now on vm-dev is about<br>
&gt; how we can either update the VM or the Scratch image so that two versions<br>
&gt; of the VM may not be needed.<br>
&gt;<br>
&gt; Thanks for the work you are doing,<br>
&gt; Dave<br>
&gt;<br>
&gt; On Thu, May 10, 2012 at 09:49:57AM +0200, Miriam Ruiz wrote:<br>
&gt;&gt; 2012/5/10 David T. Lewis &lt;<a href="mailto:lewis@mail.msen.com">lewis@mail.msen.com</a>&gt;:<br>
&gt;&gt;<br>
&gt;&gt;&gt; Amos, can you please clarify if further development of the Scratch<br>
&gt;&gt;&gt; image is planned? If yes, then updating the Scratch image may be<br>
&gt;&gt;&gt; the right thing to do. If no, then we can take a harder look at<br>
&gt;&gt;&gt; coming up with a way to produce a backward compatible VM. If neither<br>
&gt;&gt;&gt; of these is feasible, then it will probably be necessary to arrange<br>
&gt;&gt;&gt; a separate source distribution for a Scratch VM.<br>
&gt;&gt;<br>
&gt;&gt; Hi!<br>
&gt;&gt;<br>
&gt;&gt; Sorry for the delay in answering to this thread. I think that it is a<br>
&gt;&gt; very sensible suggestion you&#39;re making. There is one thing I&#39;m<br>
&gt;&gt; concerned about, though: if it is finally necessary to include an<br>
&gt;&gt; aditional older version of the VM in Debian to be able to run Scratch,<br>
&gt;&gt; as other people have suggested earliuer,?who will maintain this VM?<br>
&gt;&gt;<br>
&gt;&gt; I mean, I can manage the packaging and some shallow patches if it is<br>
&gt;&gt; necessary, as I do with all my packages, but as I&#39;m not especially<br>
&gt;&gt; proficient with the VM&#39;s code not I ever worked with it at a serious<br>
&gt;&gt; level, so there&#39;s limits in what I can do. I suppose that Squeak<br>
&gt;&gt; developers won&#39;t like to have to maintain two versions of the VM, and<br>
&gt;&gt; the will probably just keep supporting, evolving and solving bugs from<br>
&gt;&gt; the latest. I don&#39;t know if Scratch developers are willing or have<br>
&gt;&gt; resources to solve big problems in the VM in case they appear, so that<br>
&gt;&gt; leaves me probably close to being alone in fixing stuff in the VM if<br>
&gt;&gt; something serious appear. I must confess that this perspective kind of<br>
&gt;&gt; scares me.<br>
&gt;&gt;<br>
&gt;&gt; To sum up, if we finally have to keep a separate version of the VM for<br>
&gt;&gt; running Scratch (and BYOB and other derivatives), we have to also find<br>
&gt;&gt; out how to handle bugs and improvements in the VM in case that they&#39;re<br>
&gt;&gt; needed.<br>
&gt;&gt;<br>
&gt;&gt; Greetings,<br>
&gt;&gt; Miry<br>
<br>
<br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div><br>