Re:Adding ANSI C11 C compiler to D so it can import and comp...
by gavinray on Monday May 10, 2021 @09:39AM
(#27105859)
Now we just need rock-solid automatic "extern (C++)" bindgen and we're g2g
[ Parent
| on HN ]
Re:Adding ANSI C11 C compiler to D so it can import and comp...
by skocznymroczny on Monday May 10, 2021 @10:46AM
(#27106515)
Has there been any notable success story with extern(c++)? I know some folks use it to interop with their own C++ code, but I haven't seen any new bindings to any popular C++ libraries.
Re:Adding ANSI C11 C compiler to D so it can import and comp...
by mhh__ on Monday May 10, 2021 @12:54PM
(#27108094)
extern(C++) is what allows the LLVM D compiler to work for example.
Binding C++ libraries is quite risky in the sense that the libraries usually aren't meant to be consumed via that API. For that reason it's mainly used (publicly at least, there are things I know that I cannot say) for exposing D to C++ in a sane way (Mangling, vtables, templates, all work, exceptions even!).