This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: guile-ffi


Gordon Matzigkeit <gord@trick.fig.org> writes:

> I firmly believe that guile-ffi is the Right Thing as far as writing
> Guile wrappers for existing libraries.  It's a PITA to have to muck
> with SCM and recompile every time I want a new function.

That's true.  But I'd say that it's the usual tradeoff: quick
development with an interpretive approach, and good performance with a
compiler.

Furthermore, I'm not convinced that we can get reliable bindings to C
code without the help of a C compiler.  Does libffi know everything it
needs to know about the ABI of a platform.  Can we extract all
necessary information from header files, without reimplementing much
of the compiler frontend?

I have not really tried it, so I might be wrong.  Up to now, I have
taken the easy way out: automatically generating glue code and
compiling this with a C compiler.  I'm pretty confident that this
works on all platforms that Guile runs on, and I don't have to sweat
the details.

There was a short discussion about this in comp.lang.scheme, subject
"Mixing Scheme and C".

> Anyway, let me know what you think, and if you're interested in
> helping,

You, I'd like to help where I can.  My current focus is on the Guile
to Gtk+ bindings, which is developing into a quite general glue
generator.  It is currently very much on the static side, but putting
some libffi into it to make it more dynamic would be cool.

Tom Lord has interfaced Systas (which is an offspring of Guile, I
think) to a C parser.  That could be very helpfull for parsing header
files.