A Day Of Writing

2 minute read

68 Days Until I Can Walk

As planned, I spent today writing about Rust, rather than coding in Rust. This feels like a good exercise for deepening my understanding of the Rust language and the tools that support it.

I had intended to write about build scripts and the broader Rust build system, but as I started diving into things, I discovered that I was quite curious about how wasm-pack works internally. This is obviously the tool for producing WASM projects with Rust, but how does it work internally? What is it doing? Presumably it interacts with Cargo, but how?

I downloaded the source code for wasm-pack from GitHub and started reading through it line-by-line to see how it works. While reading I documented what the application is doing at each stage. I realise that I really should have been doing this with Rust projects much sooner. This exercise in reading through someone elses code (a former member of the Rust core team, no less) taught me a lot about how to make effective use of the features that Rust provides. I will be continuing with this excercise tomorrow, and will release an article describing how wasm-pack works later tomorrow evening.

In other news, I dropped a message into the Rust Discord to see whether or not it would be appropriate for me to submit Fourteen Screws to arewegameyet.rs. The response I got was very postive, and in addition to being encouraged to submit this project to the website once I have a crate uploaded, it was also suggested that I should submit Fourteen Screws to the Rust gamedev newsletter which is published monthly. Hopefully I will have an article in the June edition. Exciting stuff!

Finally, I stumbled across this book—Game Development With Rust and WebAssembly by Eric Smith. This seems like a valuable resource for discovering better ways to interact with JavaScript from my Rust application. I have to admit that at points I have very much been winging it. So I’m going to set aside some time to read this book over the coming weeks.

My long-term goal for Fourteen Screws is not just to release a game engine, but also to release teaching resources to help people learn about Rust. Today felt like a good day for building connections with people who will be able to help me make a valuable teaching tool out of this project. Overall, it has been a very good day.