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?


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

> AFAIK there are two packages: SWIG and G-Wrap. Although I only use SWIG,
> some of the differences seem to be:
> 
> - SWIG supports interfaces for several scripting languages, not only for
>   guile. I contrast, G-Wrap generates only wrappers for scheme (maybe even
>   only for guile?)
> - SWIG has rudimentary (but for me sufficiently working) support for C++,
>   which doesn't seem to be true of G-Wrap. Maybe meanwhile wrappers for
>   C++ exist?

These are indeed true.  When I looked at it, though, SWIG didn't
support the current version of guile; it supported an obsolete
interface. 

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

There are.

G-Wrap is designed for guile, so it fits well.  Its author maintains
it for guile, and is interested in hearing comments.  It's designed so
a bcakend could be writen for any scheme which would allow your
application to use that scheme. 

What made me choose it, though, was the way SWIG handles objects.
SWIG represents memory objects by hex-coded pointers stored in
strings.  I really don't trust this to interact with garbage
collection.  Perhaps SWIG can handle scheme now; but it couldn't when
I looked at it. 

> However, for GNOME I suggest considering SWIG, since ISTR that one of the
> GNOME issues is not to be fixed to a single language. If you are
> interested, I could send you some examples of how I usually wrap functions
> and data structures with SWIG.

The thing to do is wrap your spreadsheet as a library for easy
extensibility, so that it's easy to write a G-Wrap or SWIG description
file.  Personally, I'd use G-Wrap, and guile-gtk, and write my GUI in
guile.  

> * Note to the maintainers: If there is interest, I could work these
> examples into a little tutorial. Some time ago I sent some comments about
> the guile web sites, stating the lack of examples as one of the big
> problems for advocating guile.

I'd find it handy.  Although you might present them as new chapters in
the guile-tut file.  I wrote most of one, following learn0 and learn1
by learn2, dynamically-loaded into a guile interpreter.  A little
Linux-specific right now.  I got sidetracked.

Andrew