r/programming • • Jul 13 '19

Herb Sutter: Why does the C++ standard ship every three years?

https://herbsutter.com/2019/07/13/draft-faq-why-does-the-c-standard-ship-every-three-years/
91 Upvotes

34 comments sorted by

57

u/jl2352 Jul 14 '19

I feel like the main reason is because of C++0x. It took 8 years, and the delay was pretty painful. Similarly Java 7.

It is a trend now for languages to move to a regular release schedule. It's much nicer for the end users. It's not just language updates. Everything has moved this way. Like remember when browser releases were every few years? Terrible times.

8

u/beefhash Jul 14 '19

It is a trend now for languages to move to a regular release schedule. It's much nicer for the end users.

It's a pain. A new language release causes people to immediately and uncompromisingly pivot to it. Stuck in the middle are people on operating systems that don't immediately ship the newest compiler versions of everything ever.

I'd lose my mind if C moved any faster than a new standard every seven years (which we promptly proceed to ignore anyway because C99 took long enough to happen).

The field is moving at breakneck pace and completely break any kind of opportunity for operating systems to have native packaging of programming languages and libraries.

11

u/jcelerier Jul 14 '19

Stuck in the middle are people on operating systems that don't immediately ship the newest compiler versions of everything ever.

Your problem is using an OS which couples the compiler version to the system. Just grab the latest LLVM .deb and be more happy and productive.

8

u/chrisgseaton Jul 14 '19

Instead of asking why are the languages developed so quickly you could ask why are the operating systems developed so slowly.

Debian 10 was just released and contains a version of Ruby from March last year.

1

u/[deleted] Jul 16 '19

some people don't want to debug strange issues with their operating systems when they want to get stuff done. Stability is necessary and Older packages are more stable than newer packages as they have had more time to be used in all manner of ways and environments revealing any bugs.

-8

u/shevy-ruby Jul 14 '19

Like remember when browser releases were every few years? Terrible times.

You mean the de-facto monopoly of Google's adChromium is now ... better? Really?

8

u/[deleted] Jul 14 '19

Everything is chrome now! Your browser (Chrome, Edgium, Opera...) is Chrome! Your apps are Chrome (Electron). Your backend (V8) is Chrome!

All I want for Christmas is 15 browser instances, each at least 500 MB, running a scripting engine on top of a VM on top of a wannabe OS, each running on top of an actual OS.

So if you either suck up to Google like most script kiddies here, or just move on with your life.

7

u/IamRudeAndDelusional Jul 14 '19

Maybe if users stopped using shitty Electron apps, people would stop shipping / creating "applications" with them.

4

u/[deleted] Jul 14 '19

How can users non-Electron apps, when the industry giants are pushing towards web-everything? To this day, the Windows Store is still laughed at in the tech media, despite the amazing security and convenience it brings to the users

-1

u/GYN-k4H-Q3z-75B Jul 14 '19

He said something that could be interpreted as bad about Google's tech stack. Get him!

0

u/[deleted] Jul 14 '19

[deleted]

0

u/[deleted] Jul 14 '19

[deleted]

4

u/shevy-ruby Jul 14 '19

I don't think he is. In both situations you can have breakage.

I remember when a supposedly stable release of gtk+ had a small typo in a function. As a result it was not possible to compile this version successfully, unless one edits the typo to the correct variant. It's a tiny error but why does this appear in a supposedly stable version?

32

u/[deleted] Jul 13 '19 edited Jul 14 '19

I wish there were more frequent drops for libstdc++, because there's really no reason it must be explicitly coupled with the release of the language.

One is an API, the other is a grammar. There should be nothing wrong with releasing multiple versions of an API based off the same grammar that's already released.

---

Edit: Seeing a lot of responses saying you can't completely de-couple grammars from all the APIs using them, and I do agree. My point was that if some APIs only require earlier versions of the grammar than those which they are first being released with, then maybe they should be part of a smaller C++ <grammar_version>.<libstdc++_version> incremental update that is only dependent on the minimum version of the grammar they require.

e.g.

  • std::filesystem

  • std::net

  • std::optional

These mostly require nothing more than c++11 -- yet they show up as late as c++17, and c++20 !

25

u/badsectoracula Jul 14 '19

In theory yes, but i think parts of that API rely on compiler magic.

Personally i'm not a fan of C++ anyway (though i still have to use it), but one thing i believe should happen (and not just to C++ but any language where it applies) is to split the standard library (both the C and the C++ ones) in two parts, one that needs compiler magic and another that builds on the first part and then have the second (the part that doesn't need compiler magic) part available as an open source library that all compilers can use.

6

u/matthieum Jul 14 '19

FWIW, this is what Rust does. core is where the magic happens, std is the OS abstraction/utility provider layer, and I agree this is a nice distinction. It's also pretty useful for embedded programming since there's no OS to build on, so no std, yet core is still necessary.

2

u/jyper Jul 14 '19

Yes and make it available in a package manager

0

u/ImprovedPersonality Jul 14 '19

Not an expert, but I can’t think of any reason why the stdlib would depend on compiler magic. When properly written, shouldn’t it be just like any other library and compile with any compiler which supports the required C++ standard?

5

u/Opening_Addendum Jul 14 '19

C++ has <type_traits> which is just compiler bultins/language level features masquerading as a library. You can't implement it without help from the compiler. C has <complex.h> which can't be implemented without compiler magic.

3

u/Plorkyeran Jul 14 '19

What do libstdc++ versions have to do with c++ language versions? It's released with new gcc versions because it's part of gcc, and gcc's release cycle is entirely disconnected from the c++ release cycle.

2

u/shevy-ruby Jul 14 '19

It's quite simple - you will run into compile-related problems if you don't have a proper libstdc++. To claim how both is decoupled from one another is trying to argue without it being based on factual realities.

A good example is LFS/BLFS:

http://www.linuxfromscratch.org/lfs/view/development/chapter05/gcc-libstdc++.html

IMO this step should not HAVE to be necessary. It's also annoying when ABIs change leading to strange compile-errors related to C++. You don't run into this problem with C. So from this point of view, I totally and completely agree with yuri_sevatz here - it would be much better if we could resolve this annoying situation related to libstdc++.

If it were to have nothing to do with c++ or gcc, then why would the LFS/BLFS book have a specific chapter to compile libstdc++ very early on during the LFS-bootstrap process? So that disproves your claim how it must be entirely disconnected from c++, purely from a practical point of view alone. There aren't that many alternatives to gcc either - there is clang/llvm and the obscure crap used on windows, but that was it mostly for when you want to compile c++ code in the wild.

Unfortunately we all know that the C++ committee worships cthulhu so they will only make things more complex rather than simpler.

1

u/Plorkyeran Jul 14 '19

What does any of that have to do with the c++ standard's release cycle?

2

u/[deleted] Jul 14 '19

There are reasons. For instance parts require rvalue references, constexpr, which you can't do without language support. Plus there's magic like std::function.

9

u/Quincunx271 Jul 14 '19

Plus there's magic like std::function.

std::function is entirely implementable in user code.

5

u/bbrabbitt Jul 14 '19

This is a good thing as C++ needs to catch up with the development of programming technology. For example, the modules and coroutines that C++20 adds to the language could improve the quality of the code as well as the efficiency(I can't remember how much time I cost on compiling when writing a medium size Qt project). If C++ doesn't continue upgrading itself, it will be replaced by other more friendly languages like golang and rust.

The C++ standard committee has made efforts on improving the end-user experience in a wrting C++ program. Although many people criticize C++'s bad design, for me I can't blame their effort.

5

u/circlesock Jul 14 '19

The problem is knowing which bits to ignore (i.e. goddamn most of it) and which bits to use, and getting everyone on your team ignoring and using the same bits. So much of C++ is just crap, they never throw anything away, because backward compat. This is actually a very successful strategy (see: x86 architecture, Microsoft Windows), but makes it just godawful to deal with. So many other things will never be "popular" or "mainstream" like C++. But they can still be better.

-14

u/shevy-ruby Jul 14 '19

They do it so that they can sell C++ support - because you are going to need it as the standards committee keeps on worshipping cthulhu, and making C++ more and more complex - and bigger - with every release.

-27

u/Workaphobia Jul 13 '19

In other words, the standards committee discovers continuous delivery.

0

u/[deleted] Jul 14 '19

[deleted]

9

u/MindSpark289 Jul 14 '19

That's why you write to the finalized C++11 standard, or C++14, or C++17. All it takes is passing -std=C++11 in the command line.

The updates don't delete the old standard

0

u/[deleted] Jul 14 '19

[deleted]

11

u/Alphaetus_Prime Jul 14 '19

The whole thesis of this article is that it's better to have a regular release schedule and delay stuff that isn't ready to the next release than it is to delay the release itself

-22

u/suhcoR Jul 13 '19

pure actionism

-53

u/tonefart Jul 13 '19

If you need to keep releasing new versions for C++, it means you fucked up every revision/modifications for the language that you need to correct with newer version number.

23

u/jcelerier Jul 14 '19

yes, btw why aren't you using linux 1.0 or DOS 1.0 ?

9

u/GerwazyMiod Jul 14 '19

So what we should do in your opinion? Stick with COBOL?

2

u/[deleted] Jul 16 '19

shhh... don't say that! the COBOL place in my city will get offended..