Recurse Center: Week 1

8 Jul 2024

I’m one week in to my batch at the Recurse Center! Here’s what I’ve done and learned so far.

Monday and Tuesday were a little more orientation-y last week, so I got to virtually meet a lot of folks from my batch and get a sense of what other people are working on. Despite coming in with no interest or experience in audio programming, the enthusiasm of some other folks may sway me to try to learn digital audio basics over the next 11 weeks.

My first project was a tiny, practical one: Hindsight, a timer app that reminds me to take a 20 second break every 20 minutes. It’s my first time writing any Swift, so I’m sure it’s unidiomatic as all heck. There are plenty of improvements I’d like to make (only start the timer when I’m back at my keyboard, be smarter about detecting whether I’m in a video / audio call, don’t have the SwiftUI “hello world” window open all the time) but they’re not big priorities for me right now. It’s good enough!

I wrote a memory-mapped B+Tree in Rust following along “Build Your Own Database From Scratch in Go”. Along the way I learned what “logs” mean in the context of databases, the difference between a B+Tree and an LSM tree, and the impact of disk sectors on small IO performance. Overall this was pretty fun: it involved a lot more use of unsafe in Rust than I would normally make. Unfortunately that’s also a sign that a B+Tree isn’t a great fit for Rust (because you have to copy the keys around) and that memory mapping isn’t super ergonomic in Rust (because managing allocations in a fixed buffer is pretty annoying).

For that reason I’m going to stop the project before the second half of the book, and instead follow along the CodeCrafters Build Your Own SQLite course with some of my batchmates. For the CodeCrafters course I’m planning to use Zig, because this seems like a perfect opportunity to tear myself away from Rust for a second and explore. My last attempt to use Zig ended because I was frustrated with its choice of abstractions, but a more guided approach might ease me in.

Later in the week I paired on Tim’s log2src project and drove while we did some refactoring. It’s super cool to watch the debugger integration: you can step through the logs line-by-line, and VSCode highlights what line of your program printed the log. It even reconstructs the most likely call stack to get to that log point! I would never have thought that was even possible.

I also worked on the language server for my (as of yet unnamed) hobby programming language. Expect a more in-depth post about the language and my LSP work on it later!

My only regret for week 1 is that I wasn’t social enough. I spent too long heads down and not enough time pairing and hanging out. My main goals for week 2 are to change that, to make lots of progress on the SQLite course, and to maybe start reading about digital audio.