On 2/23/08, Brian Brown <rbb@techgame.net> wrote:

Hello folks,

Is it possible to embed squeak in a host C application with it's own
thread (if needed)?

Is so, how could I get started?  ;-)



Hi Brian.

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.

The VM is automatically converted from Smalltalk to C using VMMaker. The generated code is mostly readable.

Start at http://www.squeakvm.org/, and search http://wiki.squeak.org/ (i.e. Google for "squeak vm build instructions site:wiki.squeak.org") 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.

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.

Gulik.


--
http://people.squeakfoundation.org/person/mikevdg
http://gulik.pbwiki.com/