Herb Sutter has an interesting proposal
The new “basic Hello-World with a single method call” would look something like:
```
main: () -> int = {
hello("World\n");
}
hello: (msg: _) =
std::cout << "Hello " << msg;
```
I guess the “pressure from Rust” is a good thing here (not to mention the Cambrian explosion with Zig, Vala, Kit etc).
Some highlights:
An alternative syntax would be a cleanly demarcated “bubble of new code” that would let us do things that we can never do in today’s syntax without breaking the world, such as to:
- double down on modern C++ (e.g., make C++20 modules and C++23
import std;
the default);- remove unsafe parts that are already superseded (e.g., no unsafe
union
or pointer arithmetic, usestd::variant
andstd::span
instead as we already teach);- have type and memory safety by default (e.g., make the C++ Core Guidelines safety profiles the default and required);
An alternative syntax would be a cleanly demarcated “bubble of new code” that would let us do things that we can never do in today’s syntax without breaking the world, such as to:
Definitely something to watch and see where it goes 🙂