11
Using Rust for Gamedev

Using Rust for Gamedev

5 years ago
Anonymous $L9wC17otzH

https://medium.com/@michelotti.matthew/using-rust-for-gamedev-2f60b0e4cc5c

I’ve recently created a new website and finished an online game named Adventures of Pascal Penguin. One of the most unique things about this game is that it was written in Rust and runs in web browsers thanks to WebAssembly. WebAssembly has only been mainstream for about a year or so, so not many games have been created like this. I want to share a little about my journey with Rust: how I started with it and how I got to this point.

Game development has been a hobby of mine for a long time. Prior to mid-2015 when Rust 1.0 was released, I had been doing gamedev in Java with LibGDX. Since this was a hobby, I chose the technologies I enjoyed using, but that isn’t to say there weren’t frustration. The biggest frustration I had with Java, aside from its verbosity, was that I found myself forced to choose between writing idiomatic Java code and writing Java code that got decent performance. For example, the LibGDX API encourages using their object pooling utilities and specialized resizable array implementations with public native arrays as fields. These are not idiomatic Java practices, but they are useful for making a game that runs smoothly. When you need to be stingy about creating objects, I’d say it’s time to find a new language.