Is there a SWIG module for Squeak?

Andreas Raab Andreas.Raab at gmx.de
Fri Sep 7 03:12:43 UTC 2001


Aaron,

> The advantages, as I see it, for a SWIG for Squeak would be:
> * speed- apparently FFI isn't that fast, compared to pluggable prims

Yes, that's definitely true. Most of the time is spent in marshalling and
setting up the stack right, all of which is implicit with SWIG.

> * ease- my brief toying with FFI has been hit and miss.

I think most of this is coming from the fact that we don't have a C parser
which could generate the definitions automatically.

> * security- apparently the FFI plugin is kind of a security
> risk, as it can load more or less any shared lib on a system.
> With pluggable prims or SWIG extension code, only those explicity
> .so/modules can be used.

Actually that's not the entire story. There's a lot more to security. One
example is passing around raw C pointers. Once you're allowed to do this
it's trivial to find a way of breaking into the system. As far as I
understand, SWIG does not at all deal with any of the problems of exposing
things that are neither atomic data types (like float/int) but should be
wrapped in some more or less secure way.

Cheers,
  - Andreas





More information about the Squeak-dev mailing list