Re:D Language accepted for inclusion in GCC
by jjnoakes on Wednesday June 21, 2017 @11:09AM
(#14604438)
https://dlang.org/spec/cpp_interface.html
[ Parent
| on HN ]
Re:D Language accepted for inclusion in GCC
by seren on Wednesday June 21, 2017 @12:11PM
(#14605033)
> D understands how C++ function names are "mangled" and the correct C++ function call/return sequence.
How does it work in practice ? C++ name mangling is not standardized and so every compiler can implement its own scheme. So does it mean there is a list of D compatible c++ compiler somewhere ? I have the feeling that if you are using some exotic proprietary c++ compiler it won't work well.
Re:D Language accepted for inclusion in GCC
by kbenson on Wednesday June 21, 2017 @12:21PM
(#14605156)
There was some interesting discussion regarding this here recently in the comments regarding a Rust demangling library[1].
Re:D Language accepted for inclusion in GCC
by kryptiskt on Wednesday June 21, 2017 @12:17PM
(#14605109)
In practice there are two dominating standards nowadays, the Itanium ABI and Microsoft's, so it's quite tractable to handle the common cases.
Re:D Language accepted for inclusion in GCC
by seren on Wednesday June 21, 2017 @12:31PM
(#14605266)
Thanks, I might be biased because I have a legacy platform still using gcc 2.7, which is older than the adoption of the Itanium ABI.
Re:D Language accepted for inclusion in GCC
by WalterBright on Wednesday June 21, 2017 @06:00PM
(#14608327)
> C++ name mangling is not standardized and so every compiler can implement its own scheme.
That's right, and the D compiler deals with that by customizing the C++ mangling for every platform.
I am just curious what the actual list is, it is surely not possible to support every version of every compiler on every platform.
Re:D Language accepted for inclusion in GCC
by WalterBright on Thursday June 22, 2017 @04:16AM
(#14610838)
We don't. We pick one.