automated C++ binding generation.. Booost D, NO , Not us. SIMD is more important.

Andrej Mitrovic andrej.mitrovich at gmail.com
Fri Mar 16 18:29:26 PDT 2012


On 2/11/12, Andrej Mitrovic <andrej.mitrovich at gmail.com> wrote:
> The D classes
> are not yet generated until I get wxc done, but wxc is 95% of the
> source of difficulty. Generating wxd should be easy after that.

Sorry for the long wait. Turns out I was *extremely* wrong about this.
Generating the D side turned out to be a hell of a lot more work then
I initially thought (mostly due to C++ and D type incompatibilities
and scoping issues).

I could have tried to generate SWIG interfaces, however I wasn't
impressed with wxPython which used thousands of lines of hand-crafted
interfaces. I'm also really not sure just how stable SWIG is for D,
especially for a large library like wxD. And then I saw that the new
wxPython codebase (the Phoenix project) uses over 11000 lines of
manually edited files that help the SIP generator do its work. I find
maintaining 11K lines of code to be a huge burden, so I stayed away
from that codebase alltogether. I want as much code to be
autogenerated as possible. Note that I didn't base my codgenerator on
wxPhp either, that codebase is very specific to php and so I've had to
go from scratch. I've initially used wxPhp just to figure out which
xml info I had to extract (I'm extracting a lot more info now compared
to wxPhp).

I've recently had a major refactoring of the autogenerator to make it
easier to generate wxd. However I have to re-edit the wxc generator
due to this new refactor (it shouldn't be too much work). On the
upside of things the autogenerator can now generate around 85000 lines
of compileable D code (that's the actual wxD library). That's around
300 files and 643 classes that compile. This is not linkable yet,
since wxc has to be recreated again. Another cool statistic is that
generating all of this takes about 4 seconds. (I can regenerate
individual files as well which only takes a split second). The xml
parser is a bit slow right now and takes some ~24 seconds to parse
around 1500 XML files. This can be optimized later. But it too can
re-parse single classes/headers which takes only a split second to do.

So now I'm starting to work on wxc generation again. Once that's done,
I have to test linking between wxd and wxc. Then, I have to fix any
runtime segfaults I might run into (there's bound to be a few codegen
issues). Once I have a few wxD samples working on the major platforms,
I'll release an alpha of wxD (+ the codegenerator) and then we can
start testing the library more thoroughly before any official release.

So, stay tight! Good times ahead. :)


More information about the Digitalmars-d mailing list