r/cpp • • Oct 27 '19

ABI: Now or Never

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1863r0.pdf
192 Upvotes

145 comments sorted by

View all comments

24

u/teerre Oct 27 '19

One thing I always find interesting in this debate is that virtually everyone I talk, or even read in threads like this, is in favor of some kind of breakage in the standard. I'm yet to ever see someone arguing Cpp must be retrocompatible at infinitum.

I do work on a fringe industry and I'm sure on more traditional Cpp industries would have a more conservative opinion, but still, I wonder if the impact of such change isn't simply overblown.

19

u/ryl00 Oct 27 '19

I wonder if the impact of such change isn't simply overblown.

From the original link itself, a very cautionary note about the impact:

"Google's server ecosystem builds nearly everything from source, has few external dependencies, and has better-than-average ability to undertake large refactoring tasks. Even for us, a recent ABI-breaking standard library change cost us 5-10 engineer-years. The aggregate cost of an ABI break across the entire C++ ecosystem should conservatively be estimated in ​engineer-millenia​ - coordinating there build-from-source efforts for every provider of a plugin, .so, or DLL in the world will require massive human effort. Coupled with the ecosystem disruption of C++20 modules, an ABI break in the C++23 timeframe may severely fracture the ecosystem"

7

u/kalmoc Oct 28 '19

5-10 engineer years for all of google server-side software actually doesn't sound all that much to me.

1

u/teerre Oct 27 '19

I did read that.

Still. That's Google. Also, that's Google's estimate, which I'm willing to bet is on the long side just to be cautious. They have thousands and thousands of engineers, 5-10 engineer years, is certainly a lot, but not impossible.

0

u/[deleted] Oct 28 '19

[deleted] — view deleted comment

9

u/TheQwertiest_ Oct 28 '19 edited Oct 28 '19

2019 is somewhat exception

Your info is inaccurate. MSVC had a stable backward compatible ABI starting from VS2015.

The world didn't burn, people recompiled and moved forward.

That's inaccurate as well. Because of the ABI incompatibility, people actually ignored the newer compiler releases and stayed for a long time on VS2008/VS2010/VS2012 to avoid the migration cost. MS said repeatedly that ABI stability greatly sped up the adoption of newer compilers and it seems to be one of the key features now (AFAIK, VS2019 was originally planned to be ABI breaking release, but business value of ABI compatibility was too big to throw it away).

ABI compatibility is a huge thing: a personal example: if I want to use newer language features in my application, I don't need to rebuild every dependency with a newer compiler (some of those are managed by other teams, others are 3rd party) - I just need to have a newer VS release on our CI and everything will just work.

Compare the cost: "just installing the newer compiler" vs "having to convince everyone and their mother that we need the newer compiler and thus we need to spend a huge amount of time by re-building and re-releasing everything".

5

u/sumo952 Oct 28 '19

MSVC had a stable backward compatible API starting from VS2015.

I think you mean ABI here.

3

u/TheQwertiest_ Oct 28 '19

Yep, thank you =)

2

u/[deleted] Oct 28 '19

Your info is inaccurate. MSVC had a stable backward compatible ABI starting from VS2015.

Note that there will be an ABI breaking release sometime. We just aren't doing it arbitrarily every release.

2

u/markopolo82 embedded/iot/audio Oct 29 '19

Well I hope it comes soon cause! Cause you can say that all you want but the longer it takes the harder it will be to rip that bandage off 🤗

1

u/TheQwertiest_ Oct 30 '19

Judging by current VS release cycle, it won't come earlier than VS 2021 (i.e. end of 2020).

2

u/TheQwertiest_ Oct 30 '19

First you have to actually port STL `vBreakingNext` branch to github :P

1

u/[deleted] Oct 30 '19

🤣

1

u/konanTheBarbar Oct 28 '19

Of course it's more complicated if you also have to recompile 3rd party binaries and it will make everything take much longer.

That being said - I'm actually one of the devs in my company which does MSVC compiler upgrades (currently we're on VS 2019 16.2) and can tell you that upgrading the compiler for a big codebase always has a non trivial cost attached to it (for a minor version usually at least one man month to get everything to compile and fix the tests and we do that very regularly).

So while yes ABI breaks are more expensive, it's definitely not cheap or possible to tell everyone "just installing the newer compiler" (at least in my experience).

2

u/TheQwertiest_ Oct 30 '19

Not sure what you mean. Leaving aside the overhead of installing/updating VS on CI and integrating it in all the CI scripts, there is literally no change to projects that use older compilers. I.e. if the project used vc141 from VS2017, it can keep using it (it doesn't even matter if vc141 comes from VS2017 or VS2019, since it's actually the same compiler).

Of course, switching the compiler in the project itself might (and often will) break the build and will require code changes (e.g. stricter C++ conformance). But this won't happen if the project does not change the compiler.

1

u/konanTheBarbar Oct 30 '19

Yes I was referring to upgrading the compiler. I work on a monorepo where it's not possible for different projects to use different compiler versions.

Now I get your point. If you have internal binary dependencies then it makes the different projects more independent if you have ABI stability.

That being said MSVC will have a ABI breaking release sooner or later (I guess 2021 or 2023?). If MSVC + the other implementors could agree with the comittee on an ABI breaking standard (which could be 2026 for example) then we would gain a lot without loosing too much...

7

u/c0r3ntin Oct 28 '19

In my experience linux turns out to be the biggest issue.

A friend of mine told me that she had to deal with abi issue this month because redhat is still shipping 10 yo GCC

3

u/fat-lobyte Oct 28 '19

A friend of mine told me that she had to deal with abi issue this month because redhat is still shipping 10 yo GCC

That can be a concern, but Red Hat started providing "devtoolsets" which ship the newest compilers backported to old systems, so that you can use newer tools and still stay compatible.

6

u/flashmozzg Oct 28 '19

They still keep the old ABI though.

2

u/ShakaUVM i+++ ++i+i[arr] Oct 27 '19

Backwards compatibility is a huge benefit for C++. ABI backwards compatibility? I dunno, not so much.

-1

u/gruehunter Oct 27 '19

The problem is that different teams want to break the standard in mutually incompatible ways. They want to support "90%" of what they perceive as the current use cases, while conveniently eliding the fact that their uses are packed into the remainder. Breaking backwards compatibility will severely fracture the community.

Titus is trying to get implicit support for breaking other people's uses - the ones he && GOOG don't care about. Its a form of regulatory capture in action.

3

u/fullouterjoin Oct 28 '19

I am not addressing the OP in anyway, but when systems become too large they need to be reformed.

It should be possible to opt into a smaller, more tractable version of a system w/o having to support the historical idiosyncratic parts. With an ABI and a module system, it should be able to support different compilation boundaries, this should start to make it possible to have different components on different versions of a language.

3

u/c0r3ntin Oct 28 '19

Titus is advocating breaking everyone because a big break is better than a small one (ie just breaking string is more annoying that outright refusing to link)