C++ Bindings Generator

May 28th, 2006 | by Aldacron |

Gregor Richards has started a project at DSource called BCD, a development tool that generates bindings for C++. Here’s a blurb from his NG announcement:

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).

There are a handful of unsupported C++ features - templates, multiple inheritance (of course, since D doesn’t support it) and, to quote Gregor again, “That other crazy C++ feature you’re thinking about right now.” If your name is Ben Cooley or you have otherwise found yourself in need of such a tool, your prayers have been answered. Drop by the BCD forums and let Gregor know!

Technorati Tags: ,

Post a Comment