7 ms·
Games themselves, not game engines. Systems code, game engines, and games. This isn't meant to be an exhaustive list--it's just the domains I have experience w
by pcwalton 2y ago
Games themselves, not game engines. Systems code, game engines, and games.
This isn't meant to be an exhaustive list--it's just the domains I have experience with that Rust was a good fit for. Lest it seem like I'm saying Rust is a good fit for everything I've done, I also worked on Firefox where the UI was JavaScript, and I wouldn't hurry to rewrite that code in Rust. Nor would I want the throwaway stuff I write in Python or Ruby to be Rust.
- tptacek 2y agoI'm just saying, games are exactly one of the things I would assume Rust would be a natural fit for. :)
- hollerith 2y ago>Rust would be a natural fit for Did you leave out a "not" here?
- tptacek 2y agoNo, I don't think so? I would have predicted games as a sweet spot for Rust. Most significant game projects are done in C++, and I look at Rust as basically obsoleting C++.
- hollerith 2y agoOK. Thanks. My guess was that since almost no one will pay more for a game's having fewer security vulns, there is less benefit to incurring the expense of Rust (takes longer to learn, development speed is slightly less)
- tptacek 2y agoWhen we talk about Rust being a reasonable choice for things like (say) a CRUD app, memory safety is already table stakes; every mainstream high-level language is memory-safe. Why would you ever pick Rust over Java? The answer to that question will be an even better answer to why you'd write a game in Rust.
- School-Cotton 2y agoJava may be memory safe but it is not data race safe (unlike Rust, the compiler does not enforce cross-thread synchronization). So there is still a safety-related reason to use Rust over Java. That said, I don't really think Rust is a good choice for CRUD apps, because development velocity is more important than performance and they probably don't need to be multithreaded anyway. But Rust would have been great for a lot of "systems" stuff that was historically written in Java, like Flink or Hadoop for example.
- tptacek 2y agoI feel like I've had this debate many, many times, and it always ends in the same place: I'm willing to concede that there are a subset of correctness/reliability bugs that Rust's error handling and type system mitigate, but not that any of those bugs are material to security, which is what most people are talking about when the discussion turns to memory safety. And, of course, Rust admits concurrency bugs too! We just ran into a huge one.
- School-Cotton 2y agoI didn’t think we were having a debate. You insinuated that Rust isn’t ideal for CRUD apps, and I agreed with you.
- tptacek 2y ago"Debate" was too confrontational a word, sorry about that.
- Yujf 2y agoIts not just vulnerabilities. In theory you should also get more stability. For example I like to play Civ with a friend, but stopped because about once every 30 minutes one of us would have their game crash. If it was written in Rust, I assume it might be more stable.
- hollerith 2y agoThanks. Another consideration that favors Rust, at least for game engines, is https://news.ycombinator.com/item?id=41793725 https://news.ycombinator.com/item?id=41793725
- School-Cotton 2y agoRust's value proposition has nothing to do with security vulnerabilities, except that security vulnerabilities are a type of bug. The point of Rust is to be a language that competes in the same niche as C++ but makes it much more difficult to write large classes of bug, much broader than just "security vulns".