And in the case of apps where objects can have very dynamic lifetimes (like game engines or CAD), the borrow checker wouldn't really help with you that much since you would have to manage these with reference counting or some other way anyway (ex. arena allocation + generational indices).
What Rust excels over C++ at this point is just sane defaults / less footguns (no uninitialized memory, bounds checking even in release mode) as well as some language niceties, but Rust has its own issues for pragmatic usage (slow compilation, lackluster libraries, cumbersome to interface with C APIs, ...)
Mature Libraries: C++ has a treasure trove of well-established libraries. For niche or legacy needs, C++ might be your only option. Performance Control: When you need to micro-manage performance, C++ gives you the nitty-gritty control that can make all the difference. Industry Norms: In some fields like game development, C++ isn't just preferred, it's expected. Sticking to industry norms can sometimes outweigh the benefits of newer tech. So, while Rust has its perks, especially around safety and concurrency, C++ still holds its ground where its deep-rooted ecosystem and granular performance control come into play.
No.
That is part of the reason why so many big companies (Google, Microsoft, Amazon, etc.)[1][3][4] are pushing ahead on Rust adoption and large government agencies[5][6] are recommending memory safe languages over C and C++.
Google did a study and found that their Rust developers were twice as productive as their C++ developers [2].
Rust should be preferred over C++ unless you have no other choice.
[1] https://thenewstack.io/google-spends-1-million-to-make-rust-...
[2] https://www.theregister.com/2024/03/31/rust_google_c/?td=kee...
[3] https://www.theregister.com/2024/01/31/microsoft_seeks_rust_...
[4] https://blog.qwasar.io/blog/why-is-rust-growing-and-why-do-c...
[5] https://www.nsa.gov/Press-Room/Press-Releases-Statements/Pre...
[6] https://www.whitehouse.gov/wp-content/uploads/2024/02/Final-...
This was the case for a project I am working on that was started in the last year. The interop features in rust (and other languages) are simply not as reliable as writing kernels directly in CUDA or HIP or even DPC++. You _can_ attempt to write the GPU code in C++ and call to this from $LANG via ffi, but if you want to preserve data structures and methods to work on both the host and device, its still easier to write it once in C++.
It's really difficult to evaluate a hardware product with only a C(++) SDK using only Rust. There are of course ways around this but those are a significant amount of effort.
In terms of GUIs - there's simply no "Qt-Rust" that would work in a Rust-y way without causing massive headaches. Handling all that state is incredibly difficult in Rust, at least for me (but I recall others describing why as well).
https://github.com/carbon-language/carbon-lang/blob/f9ce0b19...
Does Firefox compile with the shipped rust compiler ?
But just like Java, its almost useless to code in it for personal or smaller projects.
For almost all of my projects where I needed performant code, the way I would do this is write it in C, and then just call the code from Python or Node. Its much easier to just focus on low level performant C code that can be written in usually one file, and then just write all the interface to it through higher level languages, especially for web frameworks.