Talking to other languages (with callbacks!) - possible solution

Daniel B. Faken faken at cascv.brown.edu
Tue May 17 11:52:53 UTC 2005


Hello all,

  For a while I've been trying to bind Squeak to talk to other languages,
and I've asked on Squeak-dev and read the Objective-C/Cocoa pages on the
Swiki, but (apart from A.Raab saying "its really not that hard to add
callbacks to the Squeak core") I haven't really seen any solutions.. until
now.

  Lately I've been working on using the D-Bus IPC project
(wwww.freedesktop.org/Software.dbus) to handle same-machine conversations
between Squeak (Croquet) and python/tcl programs (VMD & PyMol).
  Its a fairly simple system - see
http://www.linuxjournal.com/article/7744 for a recent overview.

  Since its fairly easy an efficient to do messaging this way, it seems
like it would be a good alternative to directly integrating callbacks into
Squeak (which I don't have time to do..): * very efficient, since messages
can go through Shared memory * could be even more so, if the other
language was just running independently, in another thread. * DBus is
specifically designed to be easy to bind with. * Other people are using
this standard, so there would be a growing number of interfaces that "Just
Work" (TM :).

  I currently have an implementation that mainly allows me to send
messages to external Python/GLIB/XYZ objects, but I'm working on allowing
callbacks via Squeak semaphores.  (aside: The only technical problem I see
would be with implementing Squeak-side 'Filters', which would need
callbacks to be fully general - but I could do clunkier versions without
too much trouble).

[This is mainly for Unix/Linux/OSX, but could probably easily be
transferred to MSWindows - I just don't know much about IPC there]


  So anyway I'm just posting to get feedback:  Do people see problems with
this design?  What about using it for the ObjC bridge & WxWindows stuff?
Anyone interested in collaborating? :)

  It also seems like this could be a way for Croquet to move into the
cross-language stage.  I already have python programs drawing into
TeapotMorphs, and am working on having a DBus 'interface' for TFrames..


cheers, Daniel Faken




More information about the Squeak-dev mailing list