<br><br><div><span class="gmail_quote">On 2/23/08, <b class="gmail_sendername">Brian Brown</b> <<a href="mailto:rbb@techgame.net">rbb@techgame.net</a>> 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's own<br> thread (if needed)?<br><br> Is so, how could I get started? ;-)<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 "squeak vm build instructions site:<a href="http://wiki.squeak.org">wiki.squeak.org</a>") for instructions for building the VM. You can customise the platform-specific code for opening files, allocating memory, loading the image etc if they cause problems. You'll probably also want to disable Squeak's video output, which shouldn'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>