<br><br><div><span class="gmail_quote">On 2/23/08, <b class="gmail_sendername">Brian Brown</b> &lt;<a href="mailto:rbb@techgame.net">rbb@techgame.net</a>&gt; wrote:</span><blockquote class="gmail_quote" style="margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; margin-left: 0.80ex; border-left-color: #cccccc; border-left-width: 1px; border-left-style: solid; padding-left: 1ex">
<br> Hello folks,<br><br> Is it possible to embed squeak in a host C application with it&#39;s own<br> thread (if needed)?<br><br> Is so, how could I get started?&nbsp;&nbsp;;-)<br><br></blockquote></div><br><br>Hi Brian.<br><br>The Squeak interpreter is essentially a while loop with a switch statement in it for each of the 255 bytecodes. Memory is allocated on the heap but in a platform dependent manner. There might be issues with resource contention between Squeak and your application, but it should be perfectly possible to integrate Squeak in another application.<br>
<br>The VM is automatically converted from Smalltalk to C using VMMaker. The generated code is mostly readable. <br><br>Start at <a href="http://www.squeakvm.org/">http://www.squeakvm.org/</a>, and search <a href="http://wiki.squeak.org/">http://wiki.squeak.org/</a> (i.e. Google for &quot;squeak vm build instructions site:<a href="http://wiki.squeak.org">wiki.squeak.org</a>&quot;) for instructions for building the VM. You can customise the platform-specific code for&nbsp;opening&nbsp;files,&nbsp;allocating&nbsp;memory,&nbsp;loading&nbsp;the&nbsp;image&nbsp;&nbsp;etc&nbsp;if&nbsp;they&nbsp;cause&nbsp;problems. You&#39;ll probably also want to disable Squeak&#39;s video output, which shouldn&#39;t be difficult.<br>
 <br>Igor has recently done some interesting work in essentially running Squeak as an embedded application in itself. Read his postings about the Hydra VM on the main squeak-dev mailing list for more info.<br><br>Gulik.<br>
<br><br>-- <br><a href="http://people.squeakfoundation.org/person/mikevdg">http://people.squeakfoundation.org/person/mikevdg</a><br><a href="http://gulik.pbwiki.com/">http://gulik.pbwiki.com/</a>