r/cpp • u/frostmatthew • Jul 13 '19
FAQ: 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/19
u/whichton Jul 13 '19
I continue to be amazed by Herb's ability to make complex issues seem crystal clear!
1
u/SeanMiddleditch Jul 16 '19
He's also possibly the nicest person you'll meet.
Sutter for (CPP)2020! :)
18
u/matthieum Jul 13 '19
Are we sure that our quality now is better than when were on plan (1)?
Yes.
By objective metrics, notably national body comment volume and defect reports, C++14 and C++17 have been our most stable releases ever, each about 3-4´ better on those metrics than C++98 or C++11. And the reason is because we ship regularly, and put big items into TS branches first (including full wording on how they integrate with the trunk standard) and merge them later when we know they’re more baked.
I would emphasize the "big items". As mentioned, C++14 and C++17 were "minor" releases. It is not clear to me that the lesser number of defect reports for them is predictive that C++20 will generate less defect reports than C++11 did.
C++20 will likely contains quite a few big features: module, concepts, constraints, coroutines, ... It seems harder to properly foresee the interactions of those features with the other features (and with each others), and thus more likely that a greater number of defect reports will come.
Now, don't get me wrong, a higher number of defect reports is not necessarily a bad thing! I'd rather move forward with some wobbling than stay immobile. It does, though, make me wonder whether the "higher" quality is linked to the choice between options (1) and (2), or just a coincidence.
7
u/blelbach NVIDIA | ISO C++ Library Evolution Chair Jul 14 '19
C++17 wasn't a minor release.
6
4
u/matthieum Jul 14 '19
Sutters disagrees with you:
… and C++14 and C++17 were minor releases, and C++20 is major?
Again, I think the right comparable is C++14+17+20 taken as a whole: That is our third 9-year cycle, but because we were on plan (2) we also shipped the parts that were ready at the 3- and 6-year points.
4
15
u/starman1453 Jul 13 '19
Good insight about slips in software development. It has been my experience as well, that as soon as start going for "one more feature" , you not only get behind the schedule, but the quality suffers, since the feature may break existing code, and it was not yet properly tested.
I am glad the committee has found the way to be more productive with the language, and it shows. The most problems with c++ are the years of legacy, which complicate new features, not the process of adding them.
14
u/tpecholt Jul 13 '19
I would really like to agree with you but I can't. Some new features certainly give headache to lot of us. Examples are std::future & async story, initializer_list and CTAD. You can't excuse them with legacy
7
u/tombardier Jul 13 '19
Wasn't std::async something that would have waited, if they haven't been so fixated on finally getting c++-11 out the door? I think the article indicated to me that something that wasn't ready would have been deferred 3 years, rather than be forced in to the standard because it had taken so many years already, and they just wanted it released!
5
u/yuri-kilochek Jul 13 '19
What's wrong with CTAD?
5
u/konanTheBarbar Jul 13 '19
To make it short. It's the edge cases and it's hard to get them behave correctly for all cases.
3
u/STL MSVC STL Dev Jul 14 '19
Can you provide some examples of persistent problems in the wild? (Excluding design limitations, like partial CTAD not existing yet.)
3
Jul 14 '19
Here's one I heard from some people:
CTAD can't be used generically because of the copy deduction candidate taking precedence over the initializer list constructor.
std::vector v{t};Different
Ts imply differentdecltype(v)? Nope. Thevs are the same ifT1 = intandT2 = std::vector<int>.2
3
u/STL MSVC STL Dev Jul 14 '19
Fair enough, although I think that design choice leads to fewer surprises.
1
u/yuri-kilochek Jul 14 '19
I'd argue that this is a problem with initializer_list, not CTAD.
3
Jul 14 '19
Huh? This was an explicit rule introduced only for CTAD. Could you elaborate?
2
u/yuri-kilochek Jul 14 '19
There would have been no need to introduce it if initializer list weren't a thing. If we were adding initializer list to the language after CTAD and had to introduce the very same rule, you wouldn't be blaming CTAD for that, right?
2
Jul 14 '19
I don't like the rule yes, but CTAD and initializer lists can exist without it. You said you blamed initializer lists,; I don't blame CTAD at all.
6
u/khleedril Jul 14 '19
This is a brilliantly lucid essay which directly addresses the subject of the title and provides perfectly balanced introduction, discussion and conclusions of the problem.
And the upshot is absolutely right: make a plan and stick to it: release just what is ready every three years.
6
u/kalmoc Jul 13 '19 edited Jul 14 '19
Also, note that since we went to (2), we’ve also been shipping more work (as measured by big/medium/small feature counts)
Have any big language features been introduced into the standard since c++11?
No problem! We can just pull it. [...] We have actually done this before, with C++0x concepts.
Concepts where pulled in the c++11 process which followed (1). Have any [Edit: nontrivial language] features been pulled in the new model?
I'm not against having a fixed release schedule. I'm just saying the committee has yet to prove that they are actually able to introduce major, high quality language features into c++ in this model.
8
u/sphere991 Jul 14 '19
The significant language features imo are:
C++14: generic lambdas, generalized constexpr, return type deduction for functions, variable templates
C++17:
if constexpr, structured bindings, CTAD, guaranteed copy elision, inline variablesI don't know what you consider "big" but those are all very impactful. C++17 also has fold-expressions and
template <auto>, which I would rank lower on impact scale than those above.2
u/kalmoc Jul 14 '19
Big in terms of standardization effort - we are talking about the standardization process after all. I'm no expert, but I would guess that generic lambdas and fold expressions were easy to specify. Generalized constexpr and ctad were probably more difficult. But I don't think any of those features had the same complexity as the c++11 memory model, move semantics, the initial constexpr version and now coroutines, concepts or modules.
But then: I'm not involved in the standardization process at all, so I could be completely wrong.
3
Jul 14 '19
The
std::boyer_moore_searcherwas pulled from C++14, only on the accounts of unclear wording.2
u/kalmoc Jul 14 '19
Thanks. I already clarified my post that I was asking about language features. I think those are the problematic ones. Did the searchers get actually pulled from the working draft or just not merged into it in the first place?
4
Jul 14 '19
I already clarified my post that I was asking about language features.
And I had next to no sleep last night, so I skipped over that part.
Did the searchers get actually pulled from the working draft or just not merged into it in the first place?
They were in the WD up to the very last meeting. In the last C++14 meeting they got pulled. In the words of Marshal Clow: "I knew what I wanted to say, but nobody else did!" And that's about some detail that they noticed very late. He said he figured out the right wording to make things clear in the very first C++17 meeting and the searches were among the first, if not the first, C++17 features voted in.
5
u/STL MSVC STL Dev Jul 13 '19
default_order_t was reverted for breaking ABI.
2
u/kalmoc Jul 14 '19
Thanks. I know I didn't say it explicitly, but I was actually asking about (nontrivial) language features like space ship operator or even coroutines. Those are imho the "dangerous" ones.
5
3
u/sephirostoy Jul 13 '19
What about releasing C++ standard more often like every year? Same philosophy: ship what is ready; but instead of waiting for another 3 years cycle for an almost finished feature, we would wait only for another year.
15
Jul 13 '19
Consider:
they only meet twice a year,
the final meeting before an IS is entirely focused on shipping the IS,
it usually takes multiple revisions of every consequential paper to present, polish, tweak, and refine the wording for the standard.
Consequently, nothing would get done.
7
u/kalmoc Jul 13 '19
Aren't they meeting three times a year?
Also, the committee works in stages. They are already discussing papers that will go into the standard in c++23 earliest, so I don't think it would be quite that bad. But still, I agree that a one year cycle would generate far too much overhead.
5
Jul 14 '19
Yeah it's 3 meetings.
But still, I agree that a one year cycle would generate far too much overhead.
Yeah, ISO would not be happy. There must be some time for the NBs to accept the draft. That can't happen in a week.
2
4
u/RowYourUpboat Jul 14 '19
Maybe there's something I'm missing, but why don't they just coordinate over the Internet?! A great many endeavors these days do not require everyone being in the same physical room to make progress.
19
u/blelbach NVIDIA | ISO C++ Library Evolution Chair Jul 14 '19
We all have day jobs. The face to face meetings force us to take a break from our day jobs and spend a focused week on ISO C++.
Also, for consensus building, there's no substitute for face to face human interactions. A lot of important work gets done in one on one conversations in hallways, restaurants, and bars.
A lot of work is done electronically. One of my study groups, SG15, has met 9 times via telecon since the last committee meeting in February.
There's really no substitute for a face to face meeting.
0
Jul 13 '19
[deleted]
12
u/Wh00ster Jul 13 '19
Is there a general facility for this with ISO standards?
Like wouldn’t that be a TS?
7
Jul 13 '19
That's a new language -- not that there's anything wrong with that. Even today you can take the standards document and "fork" and call it your own. Good luck with the naming tho.
0
u/Switters410 Jul 16 '19 edited Mar 25 '26
No original content remains in this post. It was wiped using Redact, possibly for reasons related to personal privacy, digital security, or data exposure reduction.
lush spotted cautious escape doll cooing innate imminent unpack steep
3
u/tvaneerd C++ Committee, lockfree, PostModernCpp Jul 15 '19
Isn't that called clang and gcc trunk?
Or go look at their branches.
1
u/flashmozzg Jul 13 '19
It'll be useless without an implementation and Implementation is hard since there is no single one.
0
Jul 13 '19
[deleted]
12
u/hak8or Jul 13 '19
I disagree, at this point c++ has so much cruft in it that is holding back the language, much like user space facing code in the Linux kernel. If we can abandon it then the language itself can be drastically improved.
19
Jul 13 '19
[removed] — view removed comment
21
u/hgjsusla Jul 13 '19
And of course we already have C++ without the backwards compatibility, it's called D and no one uses it.
A hard break in C++ backwards compatibility would most likely kill the language
10
1
0
Jul 13 '19
[deleted]
2
u/tecnofauno Jul 14 '19
Why thou? If you're going to transpile, use C instead, so that you can leverage existing compilers AND compile fast. Let's say that compile time is not one of C++ best feature.
1
u/f0urier Jul 13 '19
Interestingly we have had Comeau C++ compiler back in the day for these purposes.
35
u/TheSuperWig Jul 13 '19
This meme continues to make me chuckle.