3 ms·
Just so we're clear, your reference points for "good for high-level application code" are systems code and game engines? :)
by tptacek 2y ago
Just so we're clear, your reference points for "good for high-level application code" are systems code and game engines? :)
- pcwalton 2y agoGames 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.