4 ms·
C++ doesn't have a standardised ABI. I'm not aware of any languages that do, but I would be interested in any more information on this.
by zabzonk 5y ago
C++ doesn't have a standardised ABI. I'm not aware of any languages that do, but I would be interested in any more information on this.
- legalcorrection 5y agoCOM and Windows Runtime (WinRT) provide standardized ABIs across multiple languages. With the WinRT language projections, it's just like writing 'normal' code.
- pjmlp 5y agoAnd with C++/WinRT you even get back the experience of how it was like to do ATL development.
- legalcorrection 5y agoSo I gather that, much more than previous COM projections and templating libraries, C++/WinRT is much nicer to work with. And you can target the WinRT ABI with Rust, .NET (C#, F#, etc.), Python, and JS too.
- pjmlp 5y agoI completely disagree, C++/CX was the best that Microsoft ever had closer to C++ Builder and they killed with their office politics. On top of that, the C++/WinRT folks are adamant to push their east const preference into every Microsoft customer. If you enjoy editing IDL files without tooling support and merging generated files by hand, please do.
- asveikau 5y agoI really didn't like C++/CX from the perspective of the fact that it added weird stuff to the existing syntax of the language, and it had no other compiler onboard other than Microsoft. These two probably killed it more than "office politics".
- pjmlp 5y agoIt is a framework for doing Windows development on Visual Studio, follows the same syntax as C++/CLI, in use since 2003, it doesn't matter if anyone else is on board. Even today no other compiler can fit into WinUI/UWP workflows no matter what, unless one is willing to do lots of under the hood workarounds. Office politics driven by people without any consideration for paying customers.
- kllrnohj 5y agoC doesn't have a standardized ABI, either, and yet it's the most widely used ABI in the world anyway. Just because it isn't standardized doesn't mean it isn't stable & relied upon anyway. Clang & G++ are ABI compatible with each other, for example, and more importantly (and relevantly) both libstd++ & libcxx strive to maintain ABI compatibility ( https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html & https://libcxx.llvm.org/DesignDocs/ABIVersioning.html https://libcxx.llvm.org/DesignDocs/ABIVersioning.html )
- tambre 5y ago> both libstd++ & libcxx strive to maintain ABI compatibility They don't, but they do keep it stable.
- mst 5y agoAlternative phrasing: they strive to maintain "backwards compatibility" rather than "compatibility with each other".
- kllrnohj 5y agoFor libcxx & libstdc++ yes correct. Clang, however, does strive to maintain compatibility with G++. So you can build a library with clang & use it from g++. It strives, and for the most part achieves, to be a drop-in replacement for GCC, which includes ABI compatibility.
- seoaeu 5y agoThere's the widely used Itanium C++ ABI [0], which contrary to the name is actually the one used on x86-64. Without a standard ABI it wouldn't be possible to dynamically link C++ libraries (which includes the standard library!), especially if they weren't compiled with identical compiler versions. [0]: https://itanium-cxx-abi.github.io/cxx-abi/abi.html https://itanium-cxx-abi.github.io/cxx-abi/abi.html