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] |
I don't intend to write a C/C++ parser for G-Wrap anytime too soon, but I think it would not be difficult for it to work with one. In the simplest case, a small program would just have to convert function declarations to some format which is simple for Scheme to read (I think there are lex/yacc grammars for C out on the net somewhere), and then it should be easy to use these with G-Wrap. Exporting _types_ (rather than functions) to the Scheme interpreter (e.g. 'WidgetClass') is more difficult to automate. Specifying things like how to print them, manage memory, etc... should probably be done manually. Latent typing, keywords, and rest arguments are not supported by G-Wrap because G-Wrap is pretty simple, and these appear difficult to support in a portable manner. Writing an interface for the wrapped C-code using Scheme (e.g. a Guile module) seems (to me) a nicer, more portable way to make the interface to a library more Schemey. Since G-Wrap (load ..)'s the description file rather than reading it purely as lisp data, it is also possible to extend the capabilities of G-Wrap in the same file as that which specifies the library description. It should thus be possible to code the assumptions one wants to make about library as you write the library specification. Writing a custom wrapping utility from the ground up for a library is not too difficult (and guile-gtk looks to have done this well). The two _potential_ benefits I see for using G-Wrap is that (1) when it is ported to another interpreters (e.g. STk, SCM, Rscheme) then most of the work will have been done for porting all the individual libraries for which G-Wrap specifications have been written, and (2) if people pool their hacks for extending a single interface generator, it may save work for others later on. The benefit for writing your own wrapper utility seems to be that it can be customized more easily and of course be more suited to your tastes. I guess wrapping utilities like ILU and SWIG may make argument (1) better than G-Wrap because they support more languages than just Scheme. -Chris