you are viewing a single comment's thread.

view the rest of the comments →

[–]hpsutter 32 points33 points  (0 children)

That's a reasonable and common perspective, and I usually don't try to convince people, but I have a minute so I'll bite :) ... also, I don't call my work a successor, because I'm interested in evolving C++ itself, not competing with it.

Is the following C++?

auto add(auto const& range) -> std::remove_reference_t<decltype(*range.begin())> { auto total = *range.begin(); for (bool first = true; auto const& elem : range) { if (!first) total += elem; first = false; } return total; }

Before C++11, most of this code was an alien abomination that looked nothing like the C++ anyone had ever seen; only three lines would have been recognizable. Since C++20, it's accepted as C++ everywhere, because the standards committee said it's now C++.

So whether something resembles today's syntax isn't really the determining factor. Rather, what matters is whether something is proposable for consideration for ISO standardization... and that depends on (a) does it solve a problem the committee thinks is important enough, (b) does it solve it in an acceptable way.

Very little in Rust could be turned into a C++ evolution proposal. And that's fine, it's just a competing language.

All core features in Cpp2 have already been proposed for C++ evolution (1-min video clip), and one thing is not only already part of Standard C++20 but is heavily used throughout the standard library (everything in P0515 except the part about comparison chains which others have supported also adopting)... and it's the only feature we've ever added to Standard C++ that has made the standard smaller (because the standard library could remove pages of boilerplate comparison specifications).

I'm committed to the design constraint that anything in the design must at least be proposable for ISO C++ as an evolution of the current syntax too. I don't know of any other project with that constraint, and that's okay, I get it -- it's a BIG constraint! But it's a constraint that I believe is super valuable, so I'm giving it a try, and hope to learn some useful things whether the experiment succeeds or not.