3 ms·
There has been talk of new language frontends for C++: Cpp2 (Herb Sutter's brainchild): https://hsutter.github.io/cppfront/ https://hsutter.github.io/cppfront/
by eslaught 1y ago
There has been talk of new language frontends for C++:
Cpp2 (Herb Sutter's brainchild): https://hsutter.github.io/cppfront/ https://hsutter.github.io/cppfront/
Carbon (from Google): https://github.com/carbon-language/carbon-lang https://github.com/carbon-language/carbon-lang
In principle those could enable a safe subset by default, which would (except when explicitly opted-out) provide similar safety guarantees to Rust, at least at the language level. It's still up to the community to design safe APIs around those features, even if the languages exist. Rust has a massive advantage here that the community built the ecosystem with safety in mind from day 1, so it's not just the language that's safe, but the APIs of various libraries are often designed in an abuse-resistant way. C++ is too much of a zoo to ever do that in a coherent way. And even if you wanted to, the "safe" variants are still in their infancy, so the foundations aren't there yet to build upon.
I don't know what chance Cpp2 or Carbon have, but I think you need something as radical as one of these options to ever stand a chance of meaningfully making C++ safer. Whether they'll take off (and before Rust eats the world) is anyone's guess.
- aw1621107 1y agoI don't think Carbon is a C++ frontend like cppfront. My impression is that cppfront supports C++ interop by transpiling/compiling to C++, but Carbon compiles straight to LLVM and supports C++ interop through built-in language mechanisms.