by qalmakka · 1mo ago · 0 comments
I understand the concept but having a feature that's not consistent among compilers, targets, ... all while doing absolutely nothing to solve the _real_ problems with C++. Like that the build model is still the obsolete TU model of C, while adding multiple compile-time features that inevitably end up causing build times to skyrocket considerably. Or that modules are still DOA after 6 years. Or that the syntax is full of bullshit anti-features that could be at least fixed by having a proper build model (like Rust) and editions (like Rust).
Having yet another feature that only works sometimes with quirky semantics is dumb and I understand why many people feel like it should be shelved to prioritise the features people _really_ care about, like meta
And what are those? You seem to assume that "everyone" (except the committee) is in agreement about them.
I like the editions idea. We could have a memory-safe C++ successor without being weighed down by old mistakes.
I'd start with the basics: A scanf() replacement would be nice, having a ostream/printf() alternative, but not something for input feels very unfinished.
Basic Unicode support is also still a mess.
Another thing I don't get: Why is uninitialized memory still the default? Why haven't they made the uninitialized state explicit in any of the numerous language updates?
But then input handling is much more complex than output handling.
Also, 26 now initialises trivial variables with erroneous values, and is no longer undefined behaviour to act on them.
This is only partially true. From the proposal [0]:
> Moreover, a variable that has a well-defined, erroneous initial object representation under this proposal can still lead to undefined behaviour later on:
void f(T&);
void g(bool);
void h() {
T* p; // uninitialized, has erroneous value (e.g. null)
bool b; // uninitialized, erroneous value may not be valid bool
f(*p); // dereferencing has undefined behaviour
g(b); // undefined behaviour if b is invalid
}
[0]: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p27...Any C++ replacement language should support all the features of C++ to be suitable...
Rust is doing everything it can here, these APIs are labelled unsafe, and on a system where they can work, they will work. You can see similar in the filesystem code. On Windows, or a modern Linux, you get what you'd like to have, and on somebody's SysV clone where that's not possible it's still not possible from Rust.