<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 9, 2018 at 9:22 AM, Alistair Grant <span dir="ltr"><<a href="mailto:akgrant0710@gmail.com" target="_blank">akgrant0710@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Hi Eliot, Clément & Ben,<br>
<br>
Thanks very much for all your suggestions on getting started with the<br>
simulator.  I'll be looking at them all.<br>
<br>
Thanks again,<br>
Alistair<br>
<br></blockquote><div><br></div><div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">Another thing you can do is to simulate the simulator itself, so you can look at the code, the execution from the outside and from the inside at the same time. See picture below</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><div>| cos |</div><div>cos := StackInterpreterSimulator newWithOptions: #(ObjectMemory Spur32BitMemoryManager).</div><div>cos desiredNumStackPages: 8.</div><div>cos openOn: 'SpurVMMaker.image'.</div><div>cos systemAttributes</div><div><span style="white-space:pre-wrap">             </span>at: 2 put: '-doit';</div><div><span style="white-space:pre-wrap">              </span>at: 3 put:<span style="white-space:pre-wrap">      </span>'| cos |</div><div>cos := StackInterpreterSimulator newWithOptions: #(ObjectMemory Spur32BitMemoryManager).</div><div>cos desiredNumStackPages: 8.</div><div>cos openOn: ''SpurVMMaker.image''.</div><div>cos openAsMorph; run'.</div><div><br></div><div>cos openAsMorph; run</div></div><div><br></div><img src="cid:ii_jelchnuo0_1620fe13bc349ef8" width="379" height="473"><br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
On 8 March 2018 at 17:42, Ben Coman <<a href="mailto:btc@openinworld.com">btc@openinworld.com</a>> wrote:<br>
<span class="">><br>
><br>
><br>
> On 8 March 2018 at 22:59, Alistair Grant <<a href="mailto:akgrant0710@gmail.com">akgrant0710@gmail.com</a>> wrote:<br>
>><br>
>><br>
>> Hi Eliot,<br>
>><br>
>> On Wed, Mar 07, 2018 at 10:46:41PM +0000, <a href="mailto:commits@source.squeak.org">commits@source.squeak.org</a> wrote:<br>
>> ><br>
</span><span class="">>> > Eliot Miranda uploaded a new version of VMMaker to project VM Maker:<br>
>> > <a href="http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2347.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/<wbr>VMMaker/VMMaker.oscog-eem.<wbr>2347.mcz</a><br>
>> ><br>
>> > ==================== Summary ====================<br>
>> ><br>
>> > Name: VMMaker.oscog-eem.2347<br>
>> > Author: eem<br>
>> > Time: 7 March 2018, 2:46:20.98144 pm<br>
>> > UUID: 062614a7-e3da-4b30-997a-<wbr>9568911b9ff5<br>
>> > Ancestors: VMMaker.oscog-akg.2346<br>
>> ><br>
>> > Review of Alistair's recent FilePlugin changes:<br>
>> ><br>
>> > Alistair, in var:type: declarations use symbols for types, as these are shared in lots of cases.<br>
>><br>
</span><span class="">>> In my defense, the slang code I was looking at used strings.  But this<br>
>> makes sense and I'll change.<br>
>><br>
>><br>
</span><span class="">>> > With several plugins, but especially the FilePlugin and SocketPlugin, avoid using cCode: 'aString(...)' inSmalltalk: [passive default] because this is not simulateable.  For example in FilePlugin>>#<wbr>primitiveFileWrite you'll see<br>
>> >       bytesWritten := self<br>
>> >                                               sqFile: file<br>
>> >                                               Write: count * elementSize<br>
>> >                                               From: (interpreterProxy cCoerce: (interpreterProxy firstIndexableField: array) to: #'char *')<br>
>> >                                               At: startIndex - 1 * elementSize.<br>
>> > instead of a self cCode: 'sqFileWriteFromAt(...)' form and you'll find an implementation at FilePluginSimulator>>#sqFile:<wbr>Write:From:At:<br>
>><br>
</span><span class="">>> It looks like it's at the point where I need to understand<br>
>> the simulator (which I haven't looked at yet).<br>
>><br>
>> I haven't seen it yet, but I'll definitely watch Clémnt's video.<br>
>> Where else should I look to get started with the simulator?<br>
><br>
><br>
</span>> Here is a beginner picking the brains of the experts...<br>
> <a href="http://forum.world.st/Exploring-the-simulator-was-Re-REPL-image-for-simulation-td4896870.html" rel="noreferrer" target="_blank">http://forum.world.st/<wbr>Exploring-the-simulator-was-<wbr>Re-REPL-image-for-simulation-<wbr>td4896870.html</a><br>
><br>
> which Clement summarised here...<br>
> <a href="https://clementbera.wordpress.com/2016/05/30/simulating-the-cog-vm/" rel="noreferrer" target="_blank">https://clementbera.wordpress.<wbr>com/2016/05/30/simulating-the-<wbr>cog-vm/</a><br>
><br>
> cheers -ben<br>
<span class="im HOEnZb">><br>
><br>
>><br>
>> > In primitiveConnectToFile[<wbr>Descriptor] you write<br>
>> ><br>
>> >       interpreterProxy failed ifFalse:<br>
>> >               [^interpreterProxy pop: 3 "rcvr, name, writeFlag"<br>
>> >                                                       thenPush: filePointer].<br>
>> >       ^interpreterProxy primitiveFail.<br>
>> ><br>
>> > but there's no point calling primitiveFail a secoind time given that interpreterProxy failed tells you the primitive has already failed.  Simply write<br>
>> ><br>
>> >       interpreterProxy failed ifFalse:<br>
>> >               [interpreterProxy pop: 3 "rcvr, name, writeFlag"<br>
>> >                                                       thenPush: filePointer]<br>
>><br>
</span><div class="HOEnZb"><div class="h5">>> OK.<br>
>><br>
>> Thanks for the feedback,<br>
>> Alistair<br>
>><br>
><br>
><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><span style="font-size:12.8px">Clément Béra</span><div style="font-size:12.8px">Pharo consortium engineer</div><span style="color:rgb(0,0,238)"><a href="https://clementbera.github.io/" target="_blank">https://clementbera.github.io/</a></span><div style="font-size:12.8px"><a href="https://clementbera.wordpress.com/" target="_blank">https://clementbera.wordpress.com/</a><br></div><div style="font-size:12.8px"><span style="line-height:16px">Bâtiment B 40, avenue Halley 59650 </span><span style="font-weight:bold;line-height:16px">Villeneuve d'Ascq</span></div></div></div></div></div>
</div></div>