4 ms·
A quick look at the docs make this a definite no. The name mangling scheme is similar to (one of) C++'s so that could probably be made more compatible. However
by lucozade 12y ago
A quick look at the docs make this a definite no.
The name mangling scheme is similar to (one of) C++'s so that could probably be made more compatible.
However the vtable mechanism is completely incompatible and given the reasoning in the docs (to support structural typing), I don't think it's a big stretch to say that it's a fundamental incompatibility.
TBH I'd be quite surprised if many (any?) languages will aim for C++ ABI compatibility that's much beyond simple extensions to the C ABI. Even ignoring the lack of a standard C++ ABI, once you start getting into virtual functions, exception handling and, especially, templates, you end up constraining your language to a point where you're probably better off just using C++.
I may well be wrong on this, LLVM helps a lot with the grunt work of name mangling, exceptions, trampolines etc. so it may be possible to get to a sweet spot that supports a significant number of important libraries without hamstringing the language too much. Not going to hold my breath though...