LogLog Games

The Nugget

  • The author expresses deep frustrations with Rust's suitability for indie game development, citing issues such as the borrow checker's rigidity and the lack of rapid prototyping capabilities as major hindrances, ultimately leading to the decision to abandon Rust for game development after extensive use.

Key quotes

  • "Rust users consider the borrow checker to be a positive, because it makes them 'write good code', but the more time I spend with the language the more I doubt how much of this is true."
  • "I've often found that being unable to just move on for now and solve my problem and fix it later was what was truly hurting my ability to write good code."
  • "In Rust, sometimes just doing a thing is not possible, because the thing you might need to do is not available in the place where you're doing the thing, and you end up being made to refactor by the compiler, even if you know the code is mostly throwaway."
  • "I don't want to be separating things into more than one struct, because there's more than one thing I might want to do an if on, and having gone down the 'splitting structs' path before, it rarely works out on first try."
  • "Rust doesn't have a structural type system where we could say 'a type that has these fields', or any other solution to this problem that would work without having to redefine the struct and everything that uses it."

Key insights

Rust's Challenges in Game Development

  • Learning Curve and Continuous Refactoring: Rust's borrow checker, while promoting safe coding practices, often forces developers to refactor their code at inconvenient times, hindering rapid prototyping and iteration essential for game development.
  • Rigidity vs. Creativity: The strictness of Rust in areas like ownership and borrowing often clashes with the dynamic and creative nature of game development, leading to frequent need for workarounds that compromise code quality and development speed.
  • Ecosystem and Tooling: While Rust has a rapidly growing ecosystem, it is heavily focused on technical merits rather than practical game development needs, lacking in areas such as GUI support, hot reloading, and an approachable game engine with a comprehensive editor.

The Trade-offs with Rust in Indie Game Development

  • Safety vs. Productivity: Rust's safety features, such as the borrow checker, can protect against certain types of bugs but at the cost of developer productivity and iteration speed, particularly problematic in an indie game development context where rapid experimentation is key.
  • Performance vs. Ease of Use: Rust offers high performance "by default," but this advantage is often overshadowed by the complexities and time required to manage the borrow checker and ownership rules, especially when dealing with game-specific problems like state management and UI interactions.

Shifting Away from Rust

  • Decision to Leave Rust: Despite extensive efforts to make Rust work for game development, including creating their own tools and engines, the authors have decided to move away from Rust, highlighting the misalignment between Rust's core values and the needs of rapid, creative game development.
  • Looking Towards the Future: The authors mentioned future plans to refactor their game development tools to rely less on Rust-specific features and more on external libraries or engines that offer better support for indie game development needs, such as UI customization, hot reloading, and broader platform support.

Make it stick

  • 🚀 Rust's performance is a double-edged sword: While it excels in speed and safety, the effort to maintain these can significantly slow down the creative process of game development.
  • 💥 Flexibility trumps rigidity for creativity: Game development often demands rapid iteration and creative freedom, areas where Rust's strict systems can hinder rather than help.
  • 🛠️ Refactoring is not always progress: Being forced to refactor by Rust's compiler does not necessarily mean improving the game but could instead impede development flow.
  • 🎨 Game development is an art, not just a science: The technical perfection sought in Rust programming may not always align with the practical and artistic needs of creating engaging and fun games.
This summary contains AI-generated information and may have important inaccuracies or omissions.