Re:C++ and the Culture of Complexity (2013)
by maxxxxx on Wednesday January 31, 2018 @12:52PM
(#16275824)
Definitely agree about the ABI. In C# it's a pleasure to write libraries for others and use other libraries whereas in C++ it's almost always a pain.
[ Parent
| on HN ]
Re:C++ and the Culture of Complexity (2013)
by gpderetta on Thursday February 01, 2018 @05:20AM
(#16280745)
Standard ABI only makes sense if you are targeting a single system (.NET for C#). That's not the case for C++.
Re:C++ and the Culture of Complexity (2013)
by snarfy on Thursday February 01, 2018 @07:44AM
(#16281446)
It would definitely making interop between C# and C++ much easier. It would make interop between C++ and any language much easier. The only way to do it today is to extern "C" everything. It's ugly.
Re:C++ and the Culture of Complexity (2013)
by gpderetta on Thursday February 01, 2018 @08:32AM
(#16281704)
How would exactly an library compiled for 32 bit big endian POWER interoperate with a program written for 64 bit little endian ARM?
Re:C++ and the Culture of Complexity (2013)
by maxxxxx on Thursday February 01, 2018 @10:12AM
(#16282346)
This doesn't work with C either or does it? C has a reasonable ABI so maybe we should get to the point where exchanging C++ libraries is as easy as doing this with C
Re:C++ and the Culture of Complexity (2013)
by gpderetta on Thursday February 01, 2018 @10:29AM
(#16282487)
The point is there is no standard C++ (or even C) ABI because it is not possible to standardize one. At best you can standardize a platform specific ABI. Which is in fact what happens in practice on most platforms, but it is up to the platform mantainers and the C++ standard itself can't have nothing to say.
Regarding the C ABIs, they are the lingua franca for interchange between languages because, a) as C is semantically poor, it is the minimum common denominator, and b) it is often the OS ABI.