Idea for C++ Interop

Paul Findlay r.lph50+d at gmail.com
Sat Dec 23 01:52:45 PST 2006


> The problem is that C++ and D object models (and hence ABIs) aren't completely
> compatible. So we have to stick to the lowest Common Denominator (C) or use
> some component model like COM (it's already supported), CORBA, .NET CLR or JVM.
Yes. As an example, GCC has CNI 
(http://gcc.gnu.org/onlinedocs/gcj/About-CNI.html) which supposedly 
allows one to "write Java native methods using C++." But it has a few 
restrictions on what types of class member variables you can have, and 
what classes you can derive from etc just to try and match the object 
models. Still its kinda cool.

As for benefit over extern "C", I for one would love to be using 
Trolltech's Qt and some of the KDE4 libraries without having to wrap 
each release. Of course that would be shifting the insanity of dealing 
with the C++/D mismatch to D compiler writers.

  - Paul



More information about the Digitalmars-d mailing list