3 ms·
I've been involved with the C++ standards committee for 12+ years and my experience is that it is largely political; championing a proposal is more of a demagog
by mgaunard 3y ago
I've been involved with the C++ standards committee for 12+ years and my experience is that it is largely political; championing a proposal is more of a demagogic endeavor than anything else. Influential players have been priming contracts (that have been in the works forever) as a core objective this cycle and giving it a lot of momentum for it to happen this time. Of course if people still can't be convinced it's good enough before the deadline, it won't make the cut, but it's on track.
Now regarding undefined behaviour, it's always been the reason why the proposal isn't moving forward. Some people believe religiously undefined behaviour is evil and will oppose anything tied to it. The kind of clause you mentioned is just to appease them and attain a compromise.
But ultimately, contracts and undefined behaviour (depending on the definition you go for) are intimately linked.
Consider lower_bound. The behaviour is undefined if the input is not sorted. That's just the way it is.
You can't magically make a program well-formed if you breach preconditions even if you say optimizers are not allowed to make additional assumptions.
- tialaramex 3y ago> Consider lower_bound. The behaviour is undefined if the input is not sorted. That's just the way it is. No, it's a classic WG21 choice in that it's pointlessly worse, that's not "the way it is" it's just the way WG21 decided to define it in C++. More reasonable choices would obviously include the choice made over in std::set where lower_bound gives you a past-the-end iterator if there isn't an apparent answer for your inputs. Undefined Behaviour is the worst choice, which is why in a horrible way it makes sense as WG21's default - a group known for always choosing bad defaults. > You can't magically make a program well-formed if you breach preconditions Of course you can, it's not even hard.
- mgaunard 3y agoIgnoring the fact that WG21 is not a single person or entity, but 200 people with disjoint interests, your whole argument doesn't make sense. std::set preserves sorted as an invariant, so there is no such precondition on its lower_bound member. The important requirement for std::set is that the comparison function satisfies a strict weak ordering. Again, the behaviour is undefined if it does not. There is no substitute for correctness. You need to satisfy the requirements or stuff doesn't work. Whether the "doesn't work" means an error, a crash, corrupt memory, resource leaks or incorrect results doesn't really make much of a difference: the code is incorrect and should be fixed.
- tialaramex 3y ago> Ignoring the fact that WG21 is not a single person or entity, but 200 people with disjoint interests, your whole argument doesn't make sense. How did you get the idea that I mistakenly believed WG21 is a "single person or entity"? > There is no substitute for correctness. You need to satisfy the requirements or stuff doesn't work. Whether the "doesn't work" means an error, a crash, corrupt memory, resource leaks or incorrect results doesn't really make much of a difference: the code is incorrect and should be fixed. This is how WG21 ended up here. Programmers who believe that it just "doesn't really make much of a difference". Except, it turns out that everybody else can tell the difference
- mgaunard 3y ago> How did you get the idea that I mistakenly believed WG21 is a "single person or entity"? > > classic WG21 choice > This is how WG21 ended up here. Programmers who believe that it just "doesn't really make much of a difference". Except, it turns out that everybody else can tell the difference C++ is a practical language for practical programmers solving real problems. Language purists or Rust zealots will be happier elsewhere.
- tialaramex 3y ago> classic WG21 choice So if I said that "Uniting and Strengthening America by Providing Appropriate Tools Required to Intercept and Obstruct Terrorism" act is a classic naming choice by the US Congress your understanding would be that I've mistaken the Congress for a "single person or entity" ? Even though in reality this stupid habit (ridiculous acronyms in the titles of legislation) is indeed a hallmark of American law making and not of some imaginary single person ? I guess I can't help you. WG21 may consist of dozens of people, but the character of its decisions is a reflection of the larger body, not somehow merely a reflection of those individuals. To my mind ISO's process is tremendously ill-suited to the work of developing programming languages, and while JTC1 itself makes sense, neither SC22 nor the various working groups are a good way to develop these languages. > C++ is a practical language for practical programmers solving real problems. Language purists or Rust zealots will be happier elsewhere. The problem with this characterization as a "Practical" language is that the user community do not want your "solutions" any more being as how you think it just "doesn't really make much of a difference" what happens to them when, inevitably, you are less than perfect. That's not very practical at all.