<br><br><div class="gmail_quote">On Mon, Dec 3, 2012 at 10:42 AM, Frank Shearar <span dir="ltr">&lt;<a href="mailto:frank.shearar@gmail.com" target="_blank">frank.shearar@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">
<div class="im">On 3 December 2012 16:25, Bob Arning &lt;<a href="mailto:arning315@comcast.net">arning315@comcast.net</a>&gt; wrote:<br>
&gt;<br>
&gt; On 12/3/12 11:01 AM, Blake McBride wrote:<br>
&gt;<br>
&gt; The interaction would be slower, and the installation / integration would be<br>
&gt; more complex.<br>
&gt;<br>
&gt; I&#39;d like to understand better what sort of calls you wanted to make from C<br>
&gt; to Squeak. I was thinking the reason you wanted Squeak included was for some<br>
&gt; non-trivial processing, so the socket time might not matter much. If you are<br>
&gt; calling Squeak to convert a character from upper to lowercase, then<br>
&gt; interaction would be noticeably slower. Could you give an example or two?<br>
&gt;<br>
&gt; Back then, all we did was install the exe on the server.  Client computer<br>
&gt; connection merely loaded the latest exe.  No need to startup another app and<br>
&gt; share a socket, etc..  This would never work in instances where you have 100<br>
&gt; users all on different machines.  You&#39;d have one conflict after another.<br>
&gt;<br>
&gt; So, in your ideal world, where did Squeak get installed? Bundled in the C<br>
&gt; app on each client? As a separate app on each client? Once on a server<br>
&gt; somewhere?<br>
&gt;<br>
&gt;<br>
&gt; Also, doing it in a client/server motif as you describe means that any<br>
&gt; global state information made by one call would affect other calls.<br>
&gt;<br>
&gt; Why would there be any global information? If client #27 sent a request to<br>
&gt; the squeak app, the squeak app could limit its response to data that client<br>
&gt; would need to know.<br>
&gt;<br>
&gt;  In true reentrancy each recursive call would essentially get their own VM.<br>
&gt;<br>
&gt; They could, but what&#39;s in the VM that they really need a separate copy of?<br>
<br>
</div>It&#39;s not the VM, it&#39;s the shared state of the image that would cause a<br>
problem (if anything did). I would think, at least.<br></blockquote><div><br></div><div>The image is fine.  The problem was the global variables used in the kernel.  When creating an instance of the kernel all the C &quot;global&quot; variables in the kernel should be in a structure that gets allocated when you create the instance.  This way, when you call recursively, a new set of VM kernel variables gets allocated and one instance is totally unrelated to the others.</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 class="HOEnZb"><font color="#888888"><br>
frank<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
&gt; Cheers,<br>
&gt; Bob<br>
&gt;<br>
&gt;<br>
&gt; Thanks.<br>
&gt;<br>
&gt; Blake<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Mon, Dec 3, 2012 at 9:39 AM, Bob Arning &lt;<a href="mailto:arning315@comcast.net">arning315@comcast.net</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Seems like you could do that fairly easily without making the VM<br>
&gt;&gt; re-entrant (whatever that might mean/entail). If you thought of your Squeak<br>
&gt;&gt; app and your C app as two computers on a network, they could send each other<br>
&gt;&gt; requests and responses all day long. No magic required.<br>
&gt;&gt;<br>
&gt;&gt; Cheers,<br>
&gt;&gt; Bob<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On 12/3/12 10:10 AM, Blake McBride wrote:<br>
&gt;&gt;<br>
&gt;&gt; Greetings,<br>
&gt;&gt;<br>
&gt;&gt; I tried to integrate Squeak to a C based application more than six years<br>
&gt;&gt; ago.  The project failed because we were not able to have our application<br>
&gt;&gt; call Squeak, then have Squeak call the application, and then the application<br>
&gt;&gt; call Squeak again recursively.  An analysis of the Squeak VM revealed a<br>
&gt;&gt; kernel design consisting of a lot of global variables - quite unnecessarily.<br>
&gt;&gt; The unnecessary use of global variables over a localized structure for<br>
&gt;&gt; example unnecessarily prevented the use of Squeak as an extension language<br>
&gt;&gt; (unless you had no recursion).  I spent several days trying to re-structure<br>
&gt;&gt; the Squeak kernel but I kept running into problems and just ran out of time.<br>
&gt;&gt;<br>
&gt;&gt; As a side note, that company I was with ended up making a lot of<br>
&gt;&gt; investment in Scheme because we were easily able to integrate that language<br>
&gt;&gt; with our application.  Now, not only is Scheme used heavily within that<br>
&gt;&gt; company but many of their clients use it too to customize their application.<br>
&gt;&gt;<br>
&gt;&gt; This brings me to my question, is COG reentrant?  If not, as the author of<br>
&gt;&gt; COG, I would think it relatively easy to restructure it to be so.  Such a<br>
&gt;&gt; design capability can make a huge difference to COG&#39;s acceptance to many.<br>
&gt;&gt; It may even be the reason to switch to COG.<br>
&gt;&gt;<br>
&gt;&gt; Just sharing some thoughts.  Thanks.<br>
&gt;&gt;<br>
&gt;&gt; Blake McBride<br>
&gt;&gt;<br>
&gt;&gt; On Sun, Dec 2, 2012 at 7:55 PM, Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>&gt;<br>
&gt;&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; ...in <a href="http://www.mirandabanda.org/files/Cog/VM/VM.r2628" target="_blank">http://www.mirandabanda.org/files/Cog/VM/VM.r2628</a>.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; These fix a bug with pc mapping that could cause the Vm to crash on<br>
&gt;&gt;&gt; simple loops containing arithmetic on constants (e.g. 1 to: 20 do: [:i|<br>
&gt;&gt;&gt; 1=1]).  They also cause the instantiation primitives to pop all their<br>
&gt;&gt;&gt; arguments rather than assume their argument count is 0 or 1.  More change<br>
&gt;&gt;&gt; info available in the directory.<br>
&gt;&gt;&gt; --<br>
&gt;&gt;&gt; best,<br>
&gt;&gt;&gt; Eliot<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
<br>
</div></div></blockquote></div><br>