I need to control external processes (on *nix, but possibly other
platforms in the future). I would like to do so by embedding an
interpretable (i.e. not compiled) language into the external programs.
My squeak program needs to send & receive to/from them securely and with
decent efficiency -- e.g. via FIFOs.
The ideal thing would be to embed squeak into them, extending it to have
app-specific functions (open a new document, rotate a molecule, etc.).
But from what I can gather from the mailing list and swiki, reentrancy is
not implemented in the FFI, and getting the footprint below (e.g.) 1MB is
problematic (an issue for me since many applications could potentially be
using the embedded squeak simultaneously - I don't want to add 13MB to
each one).
I've looked at languages like Io, TCL, Lua, etc. but haven't been happy
with any of them.. (though I have implemented primitive bridges for TCL
and Io).
So my real question is: has anyone worked on creating communication
between squeak and some other small-footprint, interpreted, ffi-capable
language? Or, are there any such languages that are very similar to
Squeak/smalltalk?
(I saw some discussion of Smallscript/S#, but I need to develop for
Linux, and I prefer open-source..)
--
You might be interested in Ruby: http://www.rubycentral.com/ . Its
object model is nearly identical to Smalltalk's, and its standard
libraries are somewhat similar, but it's much more geared (both in
syntax and implementation) towards traditional unix scripting tasks. It
has a large and growing community. I've never embedded it myself, but
I know its FFI is very straightforward, and people do embed it without
too much trouble.
Once you get over missing the environment and keyword syntax, it's
pretty comfortable (even pleasant) for a Smalltalker to use.
Avi
--
I looked at Ruby, and it does indeed seem nice, but the
library/interpreter isn't reentrant.. (see http://thekode.net/ruby/rjni/)
In fact, Lua, Tcl and (I hear) Perl are the only (relevant) reentrant
scripting languages I've found (Guile may also qualify, but its too large
for me).