C++ Binding / extern(C++)

James Dennett jdennett at acm.org
Thu Mar 29 19:56:20 PDT 2007


Jari-Matti Mäkelä wrote:
> Don Clugston kirjoitti:
>> Gregor Richards wrote:
>>> PS: extern(C++) is a terrible idea. It wouldn't be cross-compatible.
>> It amazes me that most people don't seem to realise that C++ is
>> incompatible with C++.

Just as C compilers are not always ABI-compatible.  It's
just that ABIs for C are more standard than for C++.
There have been, for example, good quality C compilers
that used name mangling to achieve type-safe linkage.

> Yeah, even this (http://www.mozilla.org/hacking/portable-cpp.html) tells
> a lot. I don't know, whether I should laugh or cry.

I cry; most of what it says doesn't apply to compilers
from about the last decade.  This is what happens when
languages are hugely successful (in terms of installed
base) -- they gain legacy burdens.

If D does things well, you don't need to spread FUD
about other languages.  By all means compare, but
naive bashing of other languages doesn't make the D
community look healthy.

-- James



More information about the Digitalmars-d mailing list