bcd.gen: A generator for bindings to C++ in D

Gregor Richards Richards at codu.org
Sun May 28 15:47:43 PDT 2006


[Gregor is insane 8-D]

I'm writing a generator for bindings to C++ in D.  It's in a 
semi-working state right now, so I figured I'd tell people it exists.

It works by using GCCXML to parse the C++ header, then making extern "C" 
wrapper classes for every function in .cc files, then calling those from 
.d files made to mimic the layout of the C++ classes.  The code is ugly, 
but to the end-user it's entirely transparent.  Because it mimics the 
layout of the C++ classes, if you know how to use a library in C++, it 
should be very similar in D (with BCD bindings).

Before you ask, no, it does not support:

  * Templates
  * Multiple inheritance
  * That other crazy C++ feature you're thinking about right now

It's still in a VERY beta stage, but it's working at least enough to get 
a binding to FLTK2 and make a window with a widget.  That's something :)

It's hosted on dsource, at http://www.dsource.org/projects/bcd

  - Gregor Richards



More information about the Digitalmars-d-announce mailing list