Why this stack?
Initially, I chose to use these technologies for a couple of reasons.
- I think Rust is cool.
- I think Rust and WebAssembly have a lot of potential for the future of web development, as inexperienced and uninformed my thoughts on the subject may be.
- WebGL is the most basic form of graphics programming for the web.
I think these are pretty reasonable for choosing a stack for a personal project. And for the most part, they were.
Why I’m glad I chose this stack
Rust is a very well designed language. Writing the majority of the game’s actual logic and physics system was really pleasant once I got used to the mechanics of Rust. Writing my own vector class, implementing operator overloading, interfacing for collisions, Rust made it always feel like I was writing very robust code, and that sort of feedback as you’re coding makes the overall experience more fun. I’d go on about Rust, but plenty of others have written extensively on why it’s so great.
At the current moment, WebGL is my only experience with graphics programming in the web. It is true that there is a bit of a learning curve, but I thought it did the job just fine and it taught me a lot about graphics programming. However, I understand why people would choose to go with alternative wrappers like three.js, as most people’s projects (including mine at least as of now) don’t require the control and customization that comes with WebGL’s manual graphics work.
Why I might change things up next time
For game dev, Rust is just fine, but I might choose to use a game engine as the game becomes more complex. As far as I know right now, if you’re writing an online game in Rust, you have to do everything yourself. And although for me this was a great learning experience, if I were to focus more on the actual development and progression of creating a game, I’d prefer to use a game engine that makes a lot of things easier for me.
For other web apps, the speed that Rust offers is usually not necessary. A lot of speed is not hindered by computationally taxing things, but more from waiting for data to send back and forth between things like databases and servers. Unless I end up building a very computationally taxing web app, normal web tech stacks will work just fine.
Resources for if you want to learn any of this stack
For Rust, I think the Rust Programming Language Textbook is really awesome. After about the first 10 chapters you will know more than enough to do a lot with the language. It’s very well written, thorough, and it even has a few projects it walks you through. This is what I personally used, and in combination with playing around with some of its examples in my own environment and looking things up, I felt pretty well equipped by the start of my project.
For Rust and WebAssembly, the Rust team also has another great resource written by them. I think their Rust/Wasm book’s Conway’s Game of Life tutorial covered everything I needed to know before jumping into making my game.
Rust generally has a lot of great resources that you can find just by exploring their website.
For WebGL there are two MVP resources: Mozilla, and webglfundamentals.org. For Mozilla, I recommend just doing their standard WebGL tutorial, and the fundamentals walkthroughs for webglfundamentals.org. Anything else you will probably ever wonder about WebGL is scattered throughout the rest of those two resources. It is quite a lot to take it, but committing to these tutorials will get you through much of the beginning friction of learning.