Maybe it's just me, but I don't think template error messages are a problem that needed addressing. Nearly 100% of the time you can find the source of an error by locating the deepest point in the error stack that points to your own code, without even reading the message. And it feels like concept-like features are always the worst part of any language that has them. Traits in Rust are a gigantic pain (and their errors are IMO even more incomprehensible than template errors); where clauses in C# are so annoying that every time I need them in generic methods I remember how nice templates are to write
because they're duck-typed, and sometimes I just give up and write the method non-generically.
Rather than concepts, how about a networking header for the standard library? Hey, committee, networks are no less relevant today than they were in 1998, and I don't think they're going to become less relevant if you wait another 25 years.
- Coroutines could be great but they lack support so nobody is using them; |
I just use Boost's implementation
C++'s relationship to C is double-edged. cfront's nature as a preprocessor was surely one of the major reasons why C++ became a popular success. Unfortunately carrying C's legacy also created huge technical challenges. |
Although this is true, it's unrelated to C++ originally compiling to C. Plenty of modern languages use C as an IR primarily to avoid having to implement a full compiler backend. That a compiler emits another high-level language rather than machine language tells you nothing about how interoperable the source language and the output language will be.
All I want from a hypothetical C++ successor is:
* It
must have just as good a tool ecosystem. I'm tired of languages with no debuggers and IDEs that crap out parsing sources. GFYS, rust-analyze.
* It must have a stable compiler/runtime. If it compiles with no errors or warnings today, it should also do so 20 years from now; compiler flags are a reasonable compromise to support this. Pulling a Python 3 is unacceptable. If it needs a runtime, I should not have to tie the project to this month's version, that's going to be deprecated next month. I'm looking at you, C#.
Nice to haves:
* Easier and faster to parse. Nice just in general, but also when you're working on source processors.
* Less undefined behavior, or the ability to require defined behavior in specific regions with the understanding that it may lead to worse optimizations. Both C and C++ have far too many landmines that are too easy to step on.
* Bounds checking turned on by default, with individual checks being omittable by the compiler. Even nicer: pointer arithmetic forbidden; all accesses must be through pointers of defined sizes. Corollary: address-of operator doesn't exist.
1 2 3 4 5 6 7
|
int int_vector.get(int index){
auto p = (int[this.size] *)this.data;
//Now the compiler knows how to generate the bounds check.
//The programmer must still take care not to do anything
//that could cause the size of this.data to change.
return p[index];
}
|