3 ms·
Are you kidding? Just one very obvious example: Rust has had good interfaces for std:: optional and std::expected since v1. C++ is finally getting them in c++23
by AlotOfReading 4y ago
Are you kidding? Just one very obvious example: Rust has had good interfaces for std:: optional and std::expected since v1. C++ is finally getting them in c++23 and c++26 (maybe) respectively.
Moreover, you only have to learn Rust once because the language doesn't have nearly the same number of weird limitations and radical overhauls every 3 years. I attend the conferences and write C++ regularly. I still run into issues when reviewing teams where I have to consult the standard because I'm not sure if some weird construct is valid because everyone has their own subset of C++ they're comfortable with. God forbid you have to onboard someone new to the language and explain all the different kinds of initialization, a topic that's utterly trivial in literally any other language.
As an aside, static code analyzers are not able to provide the same kind of guarantees rustc does to arbitrary C++.
- restalis 4y ago"As an aside, static code analyzers are not able to provide the same kind of guarantees rustc does to arbitrary C++." Yes, and now the question becomes - is this due to hard limitations of the C++ as a language (in the sense that provision of such guarantees is simply impossible for static code analyzers, no matter what), or is it that static code analyzers just didn't provide so far (but can and most likely will)? I personally recognize and am thankful for Rust's effort to raise general awareness on the safeness aspect. This (awareness rising) would have been indeed hard to do without forcing this safety to the language core design, although I don't see it working well for Rust in the long run (after people will start having quality alternatives and won't have to pay the "safe by default" price that Rust asks of them).
- AlotOfReading 4y agoC and C++ are both very mature languages at this point and there have been 30-40 years of fairly intense efforts to try and retrofit memory safety onto them with analyzers, language extensions, and runtimes. I wouldn't bet money that it's provably impossible, but I think it's safe to say that we're unlikely to see a general solution in the near future.