4 ms·
What's the particular benefit Rust offers you in such a scenario? Part of the appeal of Rust is memory safety, per-compile correctness, and enforcing best pract
by printango 7y ago
What's the particular benefit Rust offers you in such a scenario? Part of the appeal of Rust is memory safety, per-compile correctness, and enforcing best practices.
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.
- rat9988 7y agoIt doesn't have to offer more. It should just offer as much as the alternatives. The rest is up to personal preference.
- logicchains 7y ago>What's the particular benefit Rust offers you in such a scenario? Part of the appeal of Rust is memory safety, per-compile correctness, and enforcing best practices. 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.
- printango 7y agoThanks. >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).
- logicchains 7y agoI didn't know that, that's scary :/
- xscott 7y ago> faster compilation 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.
- edflsafoiewq 7y agoRust has a large value proposition even if you don't care much about safety. It compiles to fast, portable binaries, it has a good library ecosystem that's easy to leverage with cargo, and it has lots of nice language features (algebraic data types, traits, RAII, etc.). There's not a lot else that offers that feature set, so diverse kinds of programmers are inevitably going to drawn to it.
- atoav 7y agoI like Rust because it makes it harder for yourself to shoot yourself in the face with something. Isolating problems is a charm in Rust code. 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.