>turns out people with money on the line will not use a language that simultaneously takes away power from the programmer while also being more difficult to write.
Rust reduces the number of Bugs by being harder to write. C++ is already an incredibly complex and incoherent language, like any language "vendor lock in" works against people choosing the right tools.
It's only harder in the sense that it's picky about what will compile. In c++ a lot of things will compile that really shouldn't, but that cost doesn't get counted in the "hard to write" reckoning. Somehow people don't add in the "oh crap it segfaulted, and I have no idea why" risk. IMO it's far better to have something that won't compile giving you a headache than something that compiles and costs you an unknown amount of time later.
I still haven't had my rust code segfault. To get to the same place with c++ I had to run a whole load of tools that aren't the compiler, but that are also more obscure and not normally mentioned in the coding tutorials.
Rust reduces productivity by being less powerful. Just look at the amount of copy and pasting/diy name mangling in the implementations of Axum and serde that are used to overcome the lack of overloading and variadics. The horrible interface of polars, the sheer verbosity of bevy. Macros galore, the dozen levels of indirection you’re forced to add by a supposedly zero cost borrow checker. No placement new, no Constexpr, no specialization, nothing. You can write c++ like rust, you can’t write rust like c++. if it wasn’t for backwards compatibility, c++ would have added almost every single selling point from rust like pattern matching and procedural macros, the only unique thing about rust would be the decisions it forces onto you and not the ones it allows. And that would truly show that it has nothing to offer. In fact carbon is that very language, a c++ with the features of rust that isn’t going to be held back by backwards compatibility. We’ll see in a decade which one has better adoption.
I think is true that C++ is the most complex programming language and historically didn't came with batteries included (e.g. basic stable and secure libraries that really abstract the problem at hand).
But I don't think Rust is C++ done well. It is another programming language. The Err and Ok could seem weird, traits could really be confusing. This is not against Rust, just saying that it is another programming language.
>The Err and Ok could seem weird, traits could really be confusing.
C++ allows similar error handling with std::optional (Some()/None in Rust) or std::variant (Err()/Ok() in Rust). C++ also has something similar to traits (with really unreadable syntax).
C++ just has a worse syntax for Error handling, since variants aren't enums. If you are using C++ I suggest you still make use of these concepts.
For my use cases, modern C++ is clearly more powerful/expressive than Rust in a couple areas today: metaprogramming and software where object lifetimes/ownership are unknowable at compile-time. These have a large impact on development productivity and software quality, so I'd be reluctant to give them up.
Rust has a bunch of other odd gaps, e.g. lack of proper thread-local support, but I can live with that.
If you can learn to use C++ correctly then, with the right time investment and motivation, then you can learn rust without problems.
The compiler mostly complains about things you wouldn't do in C++ anyway because it would either crash right now or it would be brittle code that would be easy to break later.
I knew enough C++ when I learned rust that I never perceived the lifetimes to be something that gets in the way.
My major pain points were:
* Leaning a new standard library, the names of common functions and common tasks to do things like handling strings, iterators etc. Nothing weird, just lots of new stuff to learn
* figuring out which libraries outside the stdlib are actually a de-facto stdlib that it's ok to just use/build around (assert_matches, bytes, ...)
* endless despair of async rust. Anyway you need to compare apples to apples, with the total cesspool that c++ coroutines are
>turns out people with money on the line will not use a language that simultaneously takes away power from the programmer while also being more difficult to write.
Rust reduces the number of Bugs by being harder to write. C++ is already an incredibly complex and incoherent language, like any language "vendor lock in" works against people choosing the right tools.