wxWidgets bindings

David T. Lewis lewis at mail.msen.com
Wed Jan 5 22:49:05 UTC 2005


On Wed, Jan 05, 2005 at 01:15:39PM -0800, wynand at realtimerodeo.net wrote:
> Bryce mentioned that a wxWidgets port would be a nice addition.
> 
> I've been meaning for a while to dip into the SWIG (www.swig.org) source
> code, so I guess that it might be nice to add a Smalltalk backend to it.
> 
> Not that this feature is a must, but SWIG enables the generation of
> so-called "director" classes that allow methods in a target language (such
> as Python, or in our case Smalltalk) to override C++ virtual methods. This
> entails the creation of a C++ class that inherits from the class in
> question and invokes the interpreter to call the appropriate method in the
> target language (i.e. Python, Smalltalk etc).

SWIG for Squeak would be a nice thing to have.

> Now, since the VM is not re-entrant (from what I gather) this probably
> cannot be implemented (depending of course of which functions are not
> re-entrant). How difficult would it be make the VM code re-entrant?

The VM is not reentrant, but it is fairly straightforward to provide
asynchronous event triggers from a C library or other external source.
Have a look at AioPlugin on SqueakMap to see how to do it. The basic
idea is to have the external library signal a Smalltalk semaphore by
means of the #signalSemaphoreWithIndex: mechanism. A Process in the
image can wait on the semaphore and handle the events.

This is the mechanism used by OSProcess to allow Squeak to be notified
when an external process exits, and to obtain the exit status for
the completed process. The Squeak VM can be single threaded(*) and
non-reentrant, but the events are still received and handled
asychronously in the image.

(*) some Squeak VMs use OS threads internally, but this does not
need to be the case.

Dave




More information about the Squeak-dev mailing list