Rustlings Session 3: When Your Sleep Schedule is More Nocturnal Than Your Code

last updated by ewan datetime loading...

(datetime loading...)

View on WhiteWind or see the record at atproto.at

4 min read • 735 words


So, Session 3 is done. Sections 10-12 knocked out in about 45 minutes around 18:00 today. Not terrible, considering I'm running on the sort of energy levels you'd expect from someone who went to sleep at 08:30 and didn't surface until 15:00. Cheers, autism, for making my circadian rhythm decide that lycanthropy is the way forward—even when the moon's only waxing gibbous.

I'm genuinely questioning why I'm even doing this. Rust isn't part of my college work next year (we'll most likely be doing C# or Visual Basic 6—yes, VB6, don't ask), and I'm already self-taught in Python, HTML, CSS, Svelte, TypeScript/JavaScript, and Bash. I've got frontend and backend covered well enough. Maybe it's just the satisfaction of watching the compiler stop shouting at me for five minutes. Maybe it's the fact that I needed something to occupy my brain while it decides whether it wants to function today.

Modules: Less Painful Than Expected

Sections 10-12 covered modules, hashmaps, and options. After the absolute nightmare that was Session 2 with enums (genuinely, what was I thinking?), these felt almost... reasonable?

The modules section was straightforward enough—bringing things into scope with use, making things public with pub. It's like Python imports but with more ceremony. The use std::time::{SystemTime, UNIX_EPOCH}; syntax felt familiar once I stopped overthinking it. Just grabbing what you need from the standard library without having to type out the full path every time.

Hashmaps were fine. They're dictionaries. I know dictionaries. The Rust syntax is a bit more verbose than Python's dict = {} but HashMap::new() does the job. The fruit basket exercises were almost therapeutic—just stuffing data into key-value pairs and watching it work. No existential crises about borrow checkers or lifetimes, just "insert apple, insert mango, done."

Options were actually quite nice to work with. The whole Some and None pattern feels more explicit than Python's None checks. Pattern matching with if let Some(value) = optional_thing has a certain elegance to it, even if it's more verbose than just checking if value is not None:.

Energy Levels: Questionable

I'm writing this at 23:30, having done the actual coding session around 18:00. My energy has been dragging all day—that sort of low-level exhaustion where your brain feels like it's running through treacle. Not ideal conditions for learning a systems programming language that's notorious for being particular about memory safety.

But somehow, 45 minutes. Compared to the 1.25 hours of Session 2 where I was apparently "an idiot with the enums" (past me's words, not mine), this felt almost effortless. Maybe I'm getting the hang of thinking in Rust patterns, or maybe these particular concepts just clicked better with my current mental state.

The Bigger Picture

The thing that's bothering me isn't really the Rust itself—it's the nagging question of why. I'm going into my fifth year of college (three years in IT already) doing... well, let's just say it's technical but not specifically systems programming. Next year won't involve Rust—it'll be C# or VB6 territory. I'm already self-taught in a decent stack: Python, HTML, CSS, Svelte, TypeScript/JavaScript, Bash. Frontend, backend, scripting—I've got the bases covered for the sort of projects I actually work on. So why am I here at nearly midnight writing about hashmaps and ownership?

Maybe it's just the satisfaction of completing something. Maybe it's because the Rust community's whole "fearless concurrency" thing appeals to my need for things to be correct. Maybe it's because I needed something challenging enough to occupy the anxious part of my brain that otherwise spends its time worrying about whether I've forgotten to lock the door or if that noise outside was definitely just a cat.

Or maybe it's just that I started this thing and I'm too stubborn to leave it unfinished.

What's Next

Session 4, presumably. Whenever I can muster the energy to sit down with the compiler again and let it tell me all the ways I'm wrong about memory management. The documentation suggests we're heading into more complex territory—error handling, generics, that sort of thing.

Right now, though, I'm going to shut down the Mac and try to convince my brain that normal people sleep at normal hours. Whether it'll listen is another matter entirely.

The moon's waxing gibbous, my sleep schedule's completely backwards, and somehow I've managed to wrangle Rust modules into submission. Not sure what that says about my priorities, but here we are.