Hacker News new | ask | show | jobs
by qw3rty01 2009 days ago
> While languages like Rust offer benefits in terms of security and stability, they cost programmers in terms of productivity. It makes sense to value safety so highly if your code is safety-critical (operating systems, aerospace, automotive, etc.), but it's much less valuable when safety isn't as important (e.g. in games).

Just want to note that there is a large benefit to this kind of safety even if you're not writing safety-critical code: lack of bugs! The biggest benefit I've seen from rust is that entire classes of bugs, some of which can be extremely difficult to root cause and fix, are removed by design. So you spend significantly less time on the later half of the project tracking down bugs, which is more than enough to offset the productivity loss at the beginning.

1 comments

This has been my experience as well. I'm building an exploratory game project in Rust to test the waters for switching to it from C++ for a professional project. Initially I was hesitant because I didn't really care about memory safety, so I didn't want to pay some mental overhead for something I didn't care about. But after using Rust for a while, I'd hands-down choose it over C++, even for projects where I feel like I don't care about either memory safety or even maintainability like single player games. The ergonomics are just so much better, the package manager exists (and is good), and the constraints placed on the architecture really just result in the program being easier to grow.

So while safety and maintainability are what Rust gets marketed for, the ergonimics and just overall productivity of the language is enough to sell me on it for game dev. Languages like Zig and Jai also seem interesting in this space, but they're far from being ready to do anything in production with. The Rust ecosystem is actually ready for production now, and the language is a pleasure to work with.