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

John Morrison <[email protected]> Tue, 4 Nov 2003 14:37:07 -0500
Newsgroups gmane.lisp.clump
Organization MaK Technologies, Inc.
Message-ID <[email protected]>
On Tuesday 04 November 2003 12:25 pm, Mario Mommer wrote:
> > > I've heard from people trying to use gccxml that it disregarded so
> > > much vital information (I don't remember the details) so that it was
> > > essentially useless for this. But things might have changed, so don't
> > > hesitate to find out and tell us ;-)

[ snip snip snip ]

> It was a personal communication. I dug up an old mail of that
> exchange, and the problems were that it sometimes reordered the slots
> of a struct, and that it lost the names of variables in function

Ouch.  That can't be good.  I have to assume it's an Official Bug --
something that would render the program suspect if not useless...

> declarations (this makes sense when parsing a header - variable names
> in prototypes are essentially redundant - but is disapointing if you
> want to write bindings).

That's too bad.  They can be important clues...

> I asked him again, and he replied that the main reason was that he
> found swig. So maybe my memories weren't too accurate. The email
> exchange is from may '03.

Funny how I'm headed the other direction.  The grass is always greener
on the other side of the fence, I suppose...  Do you know if he ran
into the same killer problems I hit?

> > I just wish that there were return value information stored in the
> > object files.  If there were, a ridiculously simple script using the
> > output of "nm" would suffice.  So near, and yet so far...
>
> How about the type of the arguments?

Those are obtained by:

(1) getting the C++ "mangled" name from "nm"

e.g., 

00005d0c T _ZNK15DtModelessVCPdu14entityToRemoveEi

and then

(2) passing the "mangled" name into "c++filt"

_ZNK15DtModelessVCPdu14entityToRemoveEi
DtModelessVCPdu::entityToRemove(int) const

Unfortunately, the return value type is not encoded into the
name. (Come to think of it, I am not sure about whether the storage
class of the entry point (whether "static" or not) is derivable from
the information available from "nm')...  Hmmm...

> Btw, the R developers seem to have modified lcc to be able to get at C
> data structs, etc:
>
> http://www.omegahat.org/Slcc/man/Slcc/html/lcc.html

Thanks, I'll check it out...

-jm

-- 
==== John Morrison
==== MAK Technologies Inc.
==== 185 Alewife Brook Parkway, Cambridge, MA 02138
==== http://www.mak.com/
==== vox:617-876-8085 x115
==== fax:617-876-9208
==== [email protected]