[plt-scheme] state of mzscheme and gtk2
> > Speaking of SWIG, I have to submit more of my mzscheme updates for
> > structure handling to SWIG, since my original submission had some
> > bugs (for nested structs) :-(
>
> I do believe that using the new foreign interface is much better than
> SWIG (otherwise I wouldn't have invested the time...), but even if
> you do use SWIG... The "foreign interface" has this name rather
> than the common "foreign function interface" because it deals with
> more than just functions. It is possible to access raw C data
> through it, and this can be done even when you use some additional C
> extension (eg, one that SWIG generates).
The main thing I like about using SWIG, is:
1. It does a great job, parsing C header files.
2. It is fantastic to implement automagic type coercion between
Scheme and C. And thereby gives the oppertunity to make GTK
function accessible as if it were completely in the Scheme Domain.
One does not necessarily have to notice that one is programming
with C functions.
3. In generates all the necessary C wrapper code to interface
with scheme.
4. Given de proper definition files, it could be so that only the
typemaps between mzscheme and C need to be changed to make
things usable for e.g. chicken or bigloo.
I'm not sure about what the common foreign function interface
looks like, but this is what I like about SWIG. Maybe a language
module in SWIG for mzscheme that implements FFI wrapper code
is interesting?
--
Hans