Re: lgtk-0.0.3 - experimental gtk bindings for Common Lisp

Nahuel Greco <[email protected]> Thu, 6 Nov 2003 10:23:21 -0300
Newsgroups gmane.lisp.clump
Organization Codenix
Message-ID <[email protected]>
On Wed, 05 Nov 2003 13:42:47 +0100
Mario Mommer <[email protected]> wrote:

> A strange Idea I had yesterday while going home: how about parsing the
> documentation? It might be in a more friendlier format. I think
> parsing the gtk/gdk/etc docs is in fact easier than parsing the
> headers. One could use all available methods (probing, gccxml, parsing
> the docs, c++filth, swig) to get a fairly high accuracy and to
> identify the harder problem cases.

I suggest you to take a look at this:

	http://www.boost.org/libs/python/pyste/doc/introduction.html

It uses gccxml, and it is the most easy way to interface C++ with another
language that I have seen. I think that is very possible to use GCCXML
to parse the C++ headers of a .so library, and then using nm to get the
mangled symbols of each c++ construct. Gccxml doesn't include the symbol
names, an alternative aproach maybe is to do the c++ mangling in lisp
code, but I think that the easiest way is to use nm and 'nm -C' to get
them from the .so, after that is only matter of using UFFI to link them
as C constructs, with maybe some macros to make them more easy to use.
Note that pyste generates C wrapper code, but with UFFI I think that
possibly you can do most of the bindings without the need of C wrapping
(maybe it is only needed for calling virtual functions, etc).


Saludos,

Nahuel Greco.