| ▲ | BinaryIgor 4 hours ago | ||||||||||||||||
Interesting how C++ is still improving; seems like changes of this kind my rival at least some of the Rust use cases; time will tell | |||||||||||||||||
| ▲ | galangalalgol 3 hours ago | parent | next [-] | ||||||||||||||||
The issue with safer c++ and modern c++ is the mirror of the problem with migrating a code base from c++ to rust. There is just so much unmodern and unsafe c++ out there. Mixing modern c++ into older codebases leaves uncertain assumptions everywhere and sometimes awkward interop with the old c++. If there was a c++23{} that let the compiler know that only modern c++ and libc++ existed inside it would make a huge difference by making those boundaries clear and you can document the assumptions at that boundary. Then move it over time. The optimizer would have an advantage in that code too. But they don't want to do that. The least they could do is settle on a standard c++abi to make interop with newer languages easier, but they don't want to do that either. They have us trapped with sunk cost on some gaint projects. Or they think they do. The big players are still migrating to rust slowly, but steadily. | |||||||||||||||||
| |||||||||||||||||
| ▲ | josephg 3 hours ago | parent | prev | next [-] | ||||||||||||||||
I’m not really sure how checks like this can rival rust. Rust does an awful lot of checks at compile time - sometimes even to the point of forcing the developer to restructure their code or add special annotations just to help the compiler prove safety. You can’t trivially reproduce those all those guardrails at runtime. Certainly not without a large performance hit. Even debug mode stdc++ - with all checks enabled - still doesn’t protect against many bugs the rust compiler can find and prevent. I’m all for C++ making these changes. For a lot of people, adding a bit of safety to the language they’re going to use anyway is a big win. But in general guarding against threading bugs, or use after free, or a lot of more obscure memory issues requires either expensive GC like runtime checks (Fil-C has 0.5x-4x performance overhead and a large memory overhead). Or compile time checks. And C++ will never get rust’s extensive compile time checks. | |||||||||||||||||
| ▲ | semiinfinitely 2 hours ago | parent | prev [-] | ||||||||||||||||
> Interesting how C++ is still improving its not | |||||||||||||||||
| |||||||||||||||||