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: Automatic stub generation?


>>>>> "M" == On 3 Sep 1998, Miguel de Icaza wrote:
    >> I am writing a spreadsheet program for the GNOME project and I
    >> am interesting in making Guile have access to the internals of
    >> the spreadsheet[1][2]
    >> 
    >> Is there any package that would help me doing the bridge code,
    >> or should I code those manually?  I remember seeing an
    >> announcement for such thing.

>>>>> "D" == Dirk Herrmann <dirk@ida.ing.tu-bs.de> writes:

    D> Hallo!

    D> AFAIK there are two packages: SWIG and G-Wrap. Although I only
    D> use SWIG, some of the differences seem to be:

    D> - SWIG supports interfaces for several scripting languages, not
    D> only for guile. I contrast, G-Wrap generates only wrappers for
    D> scheme (maybe even only for guile?)

This is true.  I will probably rewrite G-Wrap (backwards compatible of
course) to be more clean and portable and add an RScheme back-end, but
for now it only works for Guile.  It does work well though.  Note that
writing Scheme code for generating wrapping C functions is pretty
easy, so G-Wrap is nothing too fancy.  I would guess that doing
something similar for other languages would take a couple hours per
language if you know what you are doing.

    D> - SWIG has rudimentary
    D> (but for me sufficiently working) support for C++, which
    D> doesn't seem to be true of G-Wrap. Maybe meanwhile wrappers for
    D> C++ exist?

G-Wrap works with C++, but does nothing fancy to support it in any way
differently than C (I "got over" my C++ phase a few years ago and am
not too motivated to hack for it -- Scheme and C are fine for me).

    D> There are probably some aspects in favor of G-Wrap, but I
    D> especially remember these points, since they were crucial for
    D> me at the time I had to decide which packet to use.

Since G-Wrap is pretty simple and written in Scheme, I would say that
one argument might be extensibility and flexibility.  It should be
easy to hack to do whatever you might like (however, the code is a bit
messy and undocumented, so it is not as easy as it should be).  Marius
Vollmer wrote something similar for generating his gtk/gnome-guile
wrappers.  He would also be a good person to talk to about wrapping
functions for gnome projects (if you haven't already).

    D> However, for GNOME I suggest considering SWIG, since ISTR that
    D> one of the GNOME issues is not to be fixed to a single
    D> language.

This may be true.  I only looked at SWIG briefly a while ago -- at the
time it claimed its Guile support was "preliminary" and it is written
in C++ so I never gave it a full/fair try.  But if people regularly
use it for wrapping data/functions for Guile, I am sure it is fine.

-- 
Christopher Lee
http://www.cs.cmu.edu/~chrislee
chrislee@ri.cmu.edu