Week of the Crab
I’m shamefully stealing the idea of weekly journal posts from several other friends and people I follow on Twitter. This is the first.
It’s been a mostly quiet week after travelling last weekend and I really needed the time to rest, more that I initally thought. So a lot of time was spent on my couch.
I tried getting into Final Fantasy 14 (the MMORPG) and I was very happy to see that it offers the option to play as a really tall and buff woman. In many games, female player character options are short, super-thin and almost never muscular. As a very tall woman, I appreciate this chance of representation.
I was very happy with the character I made. The character creator in the game is pretty good, not too overwhelming with options but still pretty flexible. Not only could I make a tall female character but also one that doesn’t have a cute, soft, and rounded face.
However I bounced off the game because it’s clearly made to be played with a keyboard and mouse, and the console control scheme they put on top of that feels very clunky. I also got overwhelmed with all the different mechanics , quests, lore, locations, etc. It’s a bit much for me. Especially since I already play a game that’s intense in much the same way: Destiny 2. I don’t have the capacity for another one.
Because I keep running out of storage on my PS5, I finally installed a second SSD. It was much easier than I expected and requires no tools other than a small Phillips screwdriver.
There’s how-to videos on Youtube that guide you through the process. I was following this one.
Why Crabs? Because I got back into Rust (the programming language). I had tried before to learn it but due to a lack of an actual project, I never stuck with it and the difficult parts of it became frustrating. But I had planned to move my daily piano practice sheets from a Ruby/Sinatra app to a static site and save myself the hosting cost. I tried to stick with Ruby but realized (again) that templating outside of frameworks like Rails and Sinatra is a pain. Seriously, I’m continuously puzzled by how bad templating engines in the Ruby ecosystem are documented, or even available. E.g. in Sinatra, you can do template inheritance using ERB, but if you use plain ERB, you can’t. It’s a feature that Sinatra provides through some hidden magic and there’s effectively zero documentation about how it’s done.
I looked at Liquid as an alternative but it doesn’t support template inheritance at all. It’s also a Shopify thing so I would avoid it just out of spite.
So, I took the opportunity to build this thing in Rust, because the Rust ecosystem has good templating engines now. Namely tera, which I ended up using.
In my ealier attempts I struggled with really understanding the ownership concepts in Rust, never sure when something was moved or borrowed. This time though I had this excellent book and it turned out to be realy helpful to actually get a good overview and to look up things a I went along. Thanks, Nora 💜
Other resources that were helpful:
I struggled with how to organize code in my project, specifically where to put code that is used in multiple other modules. First I tried to create separate crates within the same project but it was quite cumbersome. This is the solution.
A comprehensive date/time library for Rust. It supports timezones and advanced calendar arithmetic.
I needed to serialize data structures in a couple places for this project and serialization always felt like an intimidating problem in languages with such strict type systems like Rust.
This is a way to have things like collections (Vectors, Arrays, etc) of values that have different types but implement the same trait. It comes at a small efficiency cost becuase it leads to dynamic method dispatch, but it unlocks a lot of flexibility while not compromising tyep safety. Used here.
You can find the source full code of here on Github.
🦀 🦀 🦀 🦀