Whatever you're doing, you should care about soundness. In games and HFT unsound code leads to segfaults or undefined behavior, not necessarily security issues.
There are a handful of places where safety guarantees can (in some cases) actually cause performance issues. Most common would be iterators created from nested adapters over slices of known length. But that's the kind of thing unsafe exists for and no one is going to get fussy about you using the escape hatch for the manual checks.
But most of the soundness guarantees of rust can't be avoided without a bit of effort even within unsafe blocks, and don't come with performance hits. That is because the core promise of borrow checker is that it guarantees you will not create multiple mutable aliases of the same data through your program logic (you can only really do this with manual pointer hackery, edit: or interior mutability primitives).
That's what omits things like iterator invalidation and use after move/free from being composable in the language itself, and they're things that asan and valgrind can't really catch unless you're fuzzing the crap out of your program during testing. But that's a lot of effort and developer time sitting around to make a best guess about something not happening that doesn't have performance impacts.
But really at the end of the day, soundness, memory safety, secure, these are correlated but different concepts that most programs have to deal with in one way or another.
If you wrote a game engine in Rust, and open-sourced it, you'd probably get similar grief. Because that's what Rust is largely about. Anyways, certain high performance render applications (browsers, ahem), don't seem to suffer significant penalties.
Also, I'd argue that memory safety/rce protection/etc is crucial in games, particularly ones that are online. HFT running in a contained env? Less so, for sure.
It's a modern language: no #includes, faster compilation (compared to template-heavy C++), nice macros, compile-time reflection (libraries like Serde are really nice), generally nicer stdlib than C++, decent package manager. And it's one of the only languages with RAII/destructors, which to me are one of the best things about C++.
>Also, I'd argue that memory safety/rce protection/etc is crucial in games, particularly ones that are online.
This applies to the server, but not to the graphical game client running on the user's machine, as the client is usually not accepting random inbound connections, instead it just connects to the server.
>This applies to the server, but not to the graphical game client running on the user's machine, as the client is usually not accepting random inbound connections, instead it just connects to the server.
There have been a few demonstrated RCEs in game clients (especially in P2P models which many modern games use).
You should profile/benchmark that with a couple thousand lines of code... C++ can be slow to compile (although it isn't always), but so can Rust.
I will add to your list that Rust generally has nicer error messages.
However from experience I can say that you can use Rust against the grain, which will result e.g. in constant fights with the borrowchecker, weird solutions to get around the typesystem and a ton of unsafe (=trustme) blocks.
Rust can do a lot for you, you just have to think a little more about a programs architecture and don't force paradigms like OOP onto it.
I always like to translate unsafe in my head to "trust me I checked this very thoroughly" — if there are indicators that the author doesn't deserve that trust, I just won't use their stuff.
Rust can be very safe, but you should really program on all levels. Check and abstract common low level magic you need into a libray and write extensive tests for it. Then use it from a high level.
Unsafe blocks are not per se a bad thing (in fact, they are needed to solve certain things efficiently), just make sure you really know why you need it and what you do within it.
People should be allowed to be free of harassment. I think everyone would have been better off in this case if the individuals who were so concerned about the unnecessary safety, forked Actix and had a SafeActix, that was maintained without the usage they were concerned about.
If the maintainer isn’t going to accept your patches, then it’s time to decide how to move forward without needing to resort to harassment.
Also, the internet being the way it is, if you use unsafe correctly to do things that you could have done with safe code, where the compiler would have produced the same result either way, rude internet people will probably be rude to you.
Now to your question. Rust is a language that allows you to express correct programs in a number of contexts. Memory safety and concurrent modification free code being two chief ones. What people are constantly proving is that unsafe escape hatches for performance reasons are not as regularly required as similar C implementations would make you believe.
In games and HFT, I would argue having correct programs is as important as any other area of development. That’s the gamble, that you no longer need to make the trade off of safety vs. correctness. But, for expediency of development I could understand why folks see this as a trade off that is required, but that’s really just about the maturity of the language ecosystem in those areas.
Ideally any unsafe code will be contained inside a crate and never be exposed to users of that crate. The crate says “I’m giving you these safe APIs and if you use them, then your code will be safe”, it’s a contract. The point being, for games and HFT, there are many cases where you’re interacting with hardware to improve performance, the big question then becomes, can those hardware abstractions offer safe APIs such that any code built on top of them would be safe. I’d argue Rust proves that this is possible to do, and in answer to your ultimate question, that yes, even in these contexts, Rust would allow developers of those types of programs to build more correct software.
On the other hand, very little of the Rust community actually does HFT, or understands the trade-offs. In HFT code, "caching pointers" to just about everything is extremely common, because it's super fast. So you'd be using unsafe a ton. If people got a glimpse of some of the code, I have a strong feeling that some subset would start lecturing (unironically, engineers with a decade of experience in HFT) about safety vs perf trade-offs, and ask "have you actually benchmarked", etc.
In which case the "downside" from unsafe code is much less (it's not going to leak an entire database of people's private details to the web), so would people still make such a big fuss about removing it? Especially if removing it involves any performance compromise, which in HFT at least would be unacceptable (or at least politically unacceptable when trying to sell Rust).