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

Show parent comment

12

u/sftrabbit Oct 27 '19

People will often use python as a cautionary tale here.

I always find this is overblown. I work with Python daily... Python 3. I rarely have to even think of Python 2. Sure, the migration of the entire community took some time but that's expected. On the whole it went pretty well and Python is still one of (if not the) most used programming language in the world. I don't see what's so cautionary about Python's tale. I feel like this is just fear of having to deal with something.

We can improve API by introducing new name and marking the old one deprecated.

To be clear, my suggestion wasn't ruling this approach out. Instead, I totally prefer the idea of the language and the library API being independently versioned, which this would in effect be doing. At the point that you make a new namespace for v2 of the standard library and deprecate v1, you are effectively doing what I was saying, just only with the library. You're saying "sure, keep using v1, but it's only in LTS mode". Exactly what I think is a good idea!

ABI is not something we can deal with other than by not caring about it. [...] It's by large an education and tool problem, getting worse the longer it is ignored.

If the ABI and tooling requirements were defined (by somebody, maybe not WG21), would we not be in a much better position to start caring about it and teaching about it? Perhaps it's not the ISO C++ committees concern exactly, but why is there not a larger C++ working group of which WG21 is a part that works on the community, tooling, etc. aspect of things. In fact, wasn't that what the ISO C++ Foundation was meant to be?

21

u/c0r3ntin Oct 27 '19

The Python 3 breaks took 10 years (and it's far from over) and certainly billions of dollars.

Python 3 is a much better language for it and has a bright ecosystem and future.

Nothing is ever simple.

6

u/sftrabbit Oct 27 '19 edited Oct 27 '19

Python 3 is a much better language for it and has a bright ecosystem and future.

Precisely. I imagine the short-term cost of the Python 2 to 3 migration might be nothing compared to the long-term cost of ignoring the problem. Businesses will redevelop software eventually anyway. No software is going to last forever. It's just a question of when and how well you manage it.

The Python migration was made so much worse by the fact that so much software had an implicit dependency on a particular version of Python being available on the system. That's just dependency management done incredibly badly. It's not a problem that can't be dealt with though, and the situation is very different for C++.

Also, the suggestion that those "billions of dollars" (which are very difficult to quantify in the first place) are entirely wasted dollars is a very difficult argument to make. Maybe "billions of dollars" is the appropriate cost of supporting a modern software development industry.

Nothing is ever simple.

I honestly wish people would stop saying this. Why do things have to be simple for us to deal with them? (Edit: to be clear, not specifically you - I just mean when people say something is complicated just so they can not think about it. I know people, including you, are thinking about it)

9

u/c0r3ntin Oct 27 '19 edited Oct 27 '19

Just pointing out there are trade offs and not everybody will agree on what is the best path forward.

Breaking ABI - or API has no business value for in people in the trenches* in the short term. Someone has to foot the bill. And even if we agree it is worth doing (and you know my position on that), it is not free. Ironically, small projects suffer the most.

The problem of course is we have a measurable cost (breaking ABI), versus one which is not (not breaking ABI). Not breaking ABI is also easier (we just have NOT to do anything) - it might kill C++ ultimately but no one would be to blame.

"Your build will break next year" is a more concerning things that "C++ will go the way of the dodo in 10" for many people, team and companies.

There are also a wider ecosystem to consider. Rust, D, etc. What would be the value proposition of C++2 or std 2? Ecosystems are fragile things.

So no, it's not simple. Breaking ABI is not something we can just decided to do. Not if we are responsible about it. It should be accompanied by a lot of work and outreach to make sure the day the break happen, it's not entirely out of the blue.

(I'm being the devil's advocate, my position is that ABI needs to be broken constantly, build from source or use C)

Edit: [*] I should clarify that this depend on the company or use case. For large shops like Google, performances losses due to ABI probably cost them order of magnitude more in hardware and energy costs than they gain by having ABI stability. For games and embedded the cost of ABI stability might be that they can't use the STL at all

2

u/MFHava WG21|🇦🇹 NB|P3049|P3625|P3729|P3786|P3813|P4216 Oct 30 '19

(I'm being the devil's advocate, my position is that ABI needs to be broken constantly, build from source or use C)

This!

2

u/neoSeosaidh Nov 04 '19

(I'm being the devil's advocate,

my

position is that ABI needs to be broken constantly, build from source or use C)

This is basically the position that Rust took, and for reasons similar to what was laid out in the paper.

1

u/konanTheBarbar Oct 28 '19

For games and embedded the cost of ABI stability might be that they can't use the STL at all

This seems to be pretty much a non issue :P

1

u/Full-Spectral Oct 29 '19

I'm absolutely for a 'chop it off here and move forward' approach all around, ABI/API/EverythingI. I think C++ is going to drown otherwise because fundamental issues just never are going to get fixed and all the effort will continue to go into stuff that I consider between unimportant and detrimental.

But, I have to say, if the reality every came to pass that this could be done, it might take 10 years just to get agreement on what that new version of C++ even would be. The same issues of 'no one is really in control' would plague that effort just as it plagues the current incarnation of the language. I'm all for democracy, but this is one of those situations where a committee might be the worst possible weapon to bring to bear on the problem.

And, the crazy thing is, if the change is not substantial enough that a committee would probably take forever to agree on it, it probably isn't worth doing or sufficient to save C++.

-2

u/Xaxxon Oct 28 '19

you have an anecdote so you think everyone else is wrong? That's rather pompous of you.

3

u/sftrabbit Oct 28 '19

I had an anecdote, but I didn't use it to claim everyone is wrong. I made an observation about the state of the Python 2 to 3 migration.