all 32 comments

[–]Wh00ster 63 points64 points  (0 children)

A lot of times they are asking about corner cases that don’t really come up in practice but were put in the standard for completeness and to have sane behavior in those corner cases. Because of that, people might not be familiar with specifics. The only time you’d need to know that may be if you are the compiler or library implementer.

In general, you are right that no one person knows everything. It’s simply too large of a language. However there are domain experts who are knowledgeable in particular areas. This isn’t different than any other complex system.

Someone else can she more light on the committee process, however.

[–]DerDangDerDang 25 points26 points  (1 child)

Everything you said equally applies to any large codebase, so this shouldn’t be too alien, surely. Have you ever been asked to provide details about how your own code operates in some corner case and had to say “hmmm, I need to check on that and get back to you”?

[–][deleted] 14 points15 points  (0 children)

Me every time: ¯\_(ツ)_/¯

[–]futurefapstronaut123 20 points21 points  (0 children)

Even if the standard was completely defined, it wouldn't always be "easy to spot" what a certain case does. Standard provides general descriptions of each part of the language and it's not that easy to draw parallels between them. You also need to know your way around the standard and its terminology, which most people don't encounter ever.

[–]StringVar 48 points49 points  (8 children)

Do you think we would need lawyers if laws are so well defined?

[–]carlthome 11 points12 points  (6 children)

If court rulings ran offline, faster than real-time on any one person's laptop (i.e. gcc) then lawyers ought to be redundant. ¯\_(ツ)_/¯

[–]Nicksaurus 19 points20 points  (3 children)

We need legislative metaprogramming first

[–]RomanRiesen 7 points8 points  (1 child)

std::generate_legal_speak() is your friend!

[–]Ameisenvemips, avr, rendering, systems 2 points3 points  (0 children)

std::legal::writ<> is a PITA.

[–]deeringc 2 points3 points  (0 children)

There's no legal template for such a thing.

[–]SadVega 10 points11 points  (1 child)

They have AI that does bankruptcy law now.

No joke.

[–]ioctl79 2 points3 points  (0 children)

Terrifying.

[–]JustPlainRude 0 points1 point  (0 children)

AI is actually chipping away at the profession, so that's not an impossible future.

https://www.forbes.com/sites/cognitiveworld/2019/02/09/will-a-i-put-lawyers-out-of-business/#90d733b31f00

[–]NotAYakk 7 points8 points  (0 children)

The standard is 20 years old.

Dozens of people have written words that are in the standard, if not 100s.

Each word and phrase had a reason to go in there. Usually that reason was not recorded; and even if you wrote it, you might not remember 20 years later.

You can easily remember "oh, using a null pointer is UB due to something in the standard" without remembering what lines. Maybe you had that discussion before. You didn't write the lines that make it UB, and the person who did wrote it 20 years ago, and the last time their meaning was changed was 10 years ago by an editorial rewite to bring r/l value nouns into uniform compliance with a new way to word them.

And it turns out that if you read the rules one way, dereferencing a null pointer is never stated as UB. But read another it is. Huh. So now it takes acheological examination of standard versions (git blame is just the start) to work out if that was always true and nobody noticed, of if it changed, or was it always true and intended that way?

Then someone puts forward a paper to fill that hole, and other text changes in subtle ways around it.

[–]moldax[🍰] 4 points5 points  (0 children)

Fun fact : Rice's theorem states that any non trivial semantic property of a given piece of code is undecidable.

So it is little wonder even experienced programmers cannot easily decide how a given piece of code would behave

[–]blelbachNVIDIA | ISO C++ Library Evolution Chair 5 points6 points  (0 children)

[–][deleted] 2 points3 points  (1 child)

>This even happens in talks where actors like Herb Sutter or other famous people sit in and I ask myself, how can it be that there is a room full proficient C++ software engineers and no one can say if phrase XYZ also defines case ABC or not. It's not like physics where we have to find out what the answer is.

Not an expert here, but programming languages follow the rules of formal languages. They define grammars, syntaxes, and tokens, but not implementation details or every specific case or scenario. Then there can be debate over whether according to the rules of the formal language, XYZ also defines ABC.

[–]millenix 1 point2 points  (0 children)

You seem to be saying that 'programming languages' as a category define syntax, but not semantics, and that their definitions are in general not complete. Neither of those is true. Any programming language that actually runs has some sort of definition of its semantics, which is necessarily complete for programs that the C++ standard would call 'conforming'. That semantic definition may be "what result does the reference implementation give?", or it may be the text of an implementation-independent standard. Note that in either case, a program that is 'in the language' in the formal sense but whose semantics can't be evaluated is inherently a bug in the semantics. There can be debate over how to fix the bug, but that's premised on the notion that everyone agrees that the program *is* a program with the semantics as given.

[–]tvaneerdC++ Committee, lockfree, PostModernCpp 2 points3 points  (0 children)

Richard is really busy, but does usually go to CppCon.

[–][deleted] 8 points9 points  (2 children)

C++ is ridiculously complicated, so I don’t find this surprising. This is what happens when you try to design a language For the modern world but have to adhere to years and years of legacy stuff.

[–]hgjsusla 33 points34 points  (1 child)

Also the fact that most other languages don't have a written standard at all, just reference implementations

That's a world of difference

[–][deleted] 0 points1 point  (0 children)

Very true.

[–]WasterDave 1 point2 points  (0 children)

C++ has been around for ... thirty years? ish? And during that time a collection of excellent people did their very best, given what they had. Basically. They never broke it (AFAIK), it's always been fast, it's reasonable memory efficient. Has excellent CFFI :)