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] |
Andrew Archibald writes: > 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. Dav Beazley is currently in transition from utah to chicago. He finished school and is now starting his new job. So this can take a big while. > > > 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. > Of course those backends don't come outta nothing, but need to be written by people who know the C API of the individual scheme impl very well. > 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. > That's just the exterior write representation of the objects. > > 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. The question, on which level I should start to wrap C code to scheme subrs and smobs, still causes me a lot of headache. Where is the line from where on one should stop wrapping C code and starting with scheme? For example, for my fullscreen charactercell user interfaces i've tried about anything from wrapping at the termcap/termios level and building a textwindowing system from there in scheme to wrapping high-level textwidgets like Cdialog ... In most cases wrapper tools are only of limited, temporary use. There is almost always need of occasional manual intervention. Klaus Schilling