A gentle critque..

Bill Baxter Bill_member at pathlink.com
Tue May 16 21:13:05 PDT 2006


In article <e4e0v2$i78$1 at digitaldaemon.com>, Ben Cooley says...
>
>The majority of issues Walter listed simply don't apply to the strategy I'm
>going to try.  

That's truly excellent if you're really going to give this a shot.  I wish you
luck.

> There are no issues with parsing because that task is handled
>using an external tool (GCC-XML).  There are no issues with specific C++
>language details because any construct outside of cpp vtable calls or member
>access are simply punted to wrappers in the auto generated Cpp file.
>
>As for swig, the parsing of headers in SWIG is not really adequate IMO.  It
>takes shortcuts which tend to break.  In any case, since GCC-XML exists, and it
>was actually written specifically to produce the precise sort of reflection info
>you need here, why bother with an imprecise parser like swig?  They're using
>GCC-XML for the current C++ reflection library at cern and I've personally
>parsed some of our own code here, and it works fine.  Of course Elsa also works
>on our code here after running it through the pre-processor.. which is quite
>remarkable given the extensive amount of template programming we use, but it
>doesn't parse some of the MS specific stuff which GCC-XML handles.

Fair enough.  That sounds like an argument against using SWIG for any purpose,
not just against using it to wrap D.  Maybe you'll create the startings of
XNSWIG  ("XNSWIG's Not SWIG"), a new SWIG replacement based on GCC-XML. :-)  

>In any case, I really think you can do better than wrapping. If you can get an
>accurate vtable layout, macros, method list and params, and class/struct layout
>for standard classes, you pretty much have the information that you need to
>access members and call vtable methods.
>
>For the rest: templates, complex macros, exception handling, rtti, etc.. yes,
>I'm saying it would use inline cpp {} and generate "wrapper code" for these the
>same way swig does.. and call this wrapper code via extern C function calls to
>an externally compiled and linked Cpp file.  

If you really think you can make it happen then by all means jump to it.  If it
works, many folks will sing your praises.

Regards,

Bill Baxter



More information about the Digitalmars-d mailing list