Hello Eliot,<br><br><div class="gmail_quote">On Mon, Dec 3, 2012 at 1:09 PM, Eliot Miranda <span dir="ltr">&lt;<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@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">
 <br>Hi Blake,<div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 3, 2012 at 7:10 AM, Blake McBride <span dir="ltr">&lt;<a href="mailto:blake@mcbride.name" target="_blank">blake@mcbride.name</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span style="border-collapse:collapse;color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px">Greetings,<div>
<br>
</div><div>I tried to integrate Squeak to a C based application more than six years ago.  The project failed because we were not able to have our application call Squeak, then have Squeak call the application, and then the application call Squeak again recursively.  An analysis of the Squeak VM revealed a kernel design consisting of a lot of global variables - quite unnecessarily.  The unnecessary use of global variables over a localized structure for example unnecessarily prevented the use of Squeak as an extension language (unless you had no recursion).  I spent several days trying to re-structure the Squeak kernel but I kept running into problems and just ran out of time. </div>


<div><br></div><div>As a side note, that company I was with ended up making a lot of investment in Scheme because we were easily able to integrate that language with our application.  Now, not only is Scheme used heavily within that company but many of their clients use it too to customize their application.</div>


<div><br></div><div>This brings me to my question, is COG reentrant? </div></span></blockquote><div><br></div><div>Yes it is.  It supports call-outs and call-ins.  But currently there is no support for Cog to be packaged as a DLL.  You have to start by calling C from Squeak. </div>
</div></div></blockquote><div><br></div><div>I believe the regular Squeak supports call-outs and call-ins as well.  The real question is if it can be done recursively.</div><div><br></div><div>Can you initialize a new instance of the VM in the middle of a nested call-in / callout?</div>
<div><br></div><div>Can an instance be cloned?  Destroyed?</div><div><br></div><div><br></div><div>Thanks.</div><div><br></div><div>Blake</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="gmail_extra"><div class="gmail_quote"><div> </div>
<div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span style="border-collapse:collapse;color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px"><div>

 If not, as the author of COG, I would think it relatively easy to restructure it to be so.  Such a design capability can make a huge difference to COG&#39;s acceptance to many.  It may even be the reason to switch to COG.</div>

</span></blockquote><div><br></div><div>Yes indeed.   The issue is of course funding to spend the time to make the necessary changes.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<span style="border-collapse:collapse;color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px">
<div><br></div><div>Just sharing some thoughts.  Thanks.</div><span><font color="#888888"><div><br></div><div>Blake McBride</div></font></span></span><div><div><br><div class="gmail_quote">
On Sun, Dec 2, 2012 at 7:55 PM, Eliot Miranda <span dir="ltr">&lt;<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@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">...in <span style="font-size:14px;font-family:arial,sans-serif"><a href="http://www.mirandabanda.org/files/Cog/VM/VM.r2628" target="_blank"><font color="#1155cc">http://www.mirandabanda.</font>org/files/Cog/VM/VM.r2628</a>.</span><div>



<font color="#000000" face="arial, sans-serif"><br></font></div><div><font color="#000000" face="arial, sans-serif">These fix a bug with pc mapping that could cause the Vm to crash on simple loops containing arithmetic on constants (e.g. 1 to: 20 do: [:i| 1=1]).  They also cause the instantiation primitives to pop all their arguments rather than assume their argument count is 0 or 1.  More change info available in the directory.<span><font color="#888888"><br>



</font></span></font><span><font color="#888888">-- <br>best,<div>Eliot</div><br>
</font></span></div>
<br><br>
<br></blockquote></div><br>
</div></div><br><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div><br>
</div>
<br></blockquote></div><br>