[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Future of g-wrap (and guile wrappers in general).

From: Matthew
Subject: Re: Future of g-wrap (and guile wrappers in general).
Date: Mon, 20 Aug 2001 20:45:44 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.3) Gecko/20010801

I'm very much a newbie in terms of both Guile and interlanguage bindings, but I recently spent a few days working with g-wrap, SWIG and the libguile API to add scheme support to an application, and perhaps could add a few thoughts.

> So the first question I'd like to ask is does Guile need a wrapper
> generator at all?

Working directly with the "scm_/gh_" functions was very time consuming and repetative. I had about 80 functions or so that I wanted to wrap - in the end I just stopped bothering with things like type-checking, and eventually, the idea of using Guile to script my application ;-) Well, not quite. A wrapper generator would encourage the use of Guile in places where it might not otherwise be worth the effort.

Next (actually, this was all very much in parallel) I tried to work with g-wrap, because I had it installed, and because Gnucash uses it. I had a few problems with this; firstly, I found it difficult to understand how the wrapper specification worked [possible reason: the documentation is incomplete, or more likely, I'm just not too bright :) ]. Once I had this figured out, it was still quite time consuming to specify the functions and types. The third concern I had was that it needed a g-wrap runtime library, and I didn't want to add dependancies to my application. It was obvious that g-wrap provided fine control over how the wrappers and types were created, but _most_ of the time, I didn't need it.

> Another possibility would be to consider dropping guile in favor of
> SWIG and just working to make sure Guile's SWIG support is
> sophisticated enough to provide a really good solution.

Trying SWIG alleviated most of my problems - writing the interface file involved quite literally copying and pasting sections of my app header files. It automatically created accessor functions for my structs, which saved effort. The generated code was independant of SWIG, so users didn't need another dependancy. [Also, should I ever want it, I can trivially create Perl, Eiffel, Ruby, Java and, hmm, Tcl bindings]

(though I don't think
Guile is listed on their web page).

It is mentioned at least twice at . It's not anywhere near as heavily documented as the Perl, Tcl and Python stuff though :(

To, er, wrap up, I'd love to see work done to make SWIG work better with Guile (for one, the generated code compiles with pages of warnings!) rather than have to choose between close Guile control (g-wrap) and sheer ease of use (SWIG),

Matthew R.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]