This isn’t an article about any specific topic but more of a personal update. This past Monday I started at Recurse Center for a full batch. I’m planning on putting in as much solid practice as I can in Rust to both internalize all the weirdness it has around protecting you from bugs in concurrent code, familiarizing myself more with its ecosystem, and scouting out opportunities for fixing a bug in an open source library or tool in Rust.
Additionally, I plan on exercising what’s available to me for developer tooling in Linux, so for the next three months I will be using an old Linux laptop I bought from a friend a several months ago. When I got it, I immediately installed i3wm and got it almost set up to be as comfortable as my how I use macOS, but lost interest in the project. Coming back to it, I’ve been only in Gnome/Ubuntu as I got my bearings but this weekend I started looking at i3wm again.
RC - First Impressions
There were a few icebreaker events on Monday, followed by a workshop on pair programming on Tuesday. The general advice being tossed around is to focus on meeting and learning about the people around you, which makes sense given the themes around thriving in a community.
Something that I hadn’t expected to hit me that hard is how few opportunities I had to help others this week. I’m used to being able to wander around at work and strike up conversations with the people there and at least provide some sort of guidance or help fix a problem. I hadn’t realized how much I took that rapport and those relationships for granted. This is my first time in over three years a new space and I didn’t realize how much I relied on institutional knowledge, knowing what kinds of help people needed, and my background in my domain for providing that kind of support.
At Recurse, everyone is a stranger, everyone is working on something totally different, and using a completely different stack. I worry that I have nothing to provide and there isn’t any way for me to be providing value here.
Also, nobody knows what they can reach out to me for. At work people generally know what I have a background and context in, and so when they need help in something like that they know to turn to me. In a new environment that’s not the case at all and it’ll take a while to get to the point where I can feel like I’m properly helping others.
Early Project Ideas
I’ve been using Rust on small projects on and off for a couple of years. I know the language well enough to know what to Google for and I generally know why (though not always how to solve) the compiler yells at you for borrow-checker errors.
An on-going issue I’ve noticed in my use of Rust is that I never pick a project or an implementation that benefits from the constraints that the borrow checker puts on you. A unique feature of Rust is how it aggressively prevents you from allowing any section of memory to be accessible to more than one piece of code at a time. This constraint prevents you from writing code that could have tricky bugs that are hard to reproduce and fix, but most of that code requires that you are writing something with several concurrent threads. Bugs in single-threaded programs are much easier to deal with because you can trust that your code will execute its actions in the order that they’re written. Programs with concurrent threads may have actions that happen in many possible orders, like riffling two decks of cards together, shuffling them into one deck that represents the sequence of actions that happened in the history of this particular run of the program.
By making sure that a piece of memory is only accessible to one piece of code at a time, Rust can provide order to the shuffled cards and give you the confidence that certain types of bugs around concurrency will not happen when you run your program. It does this without locks that would slow down your program, and at compile-time before you’ve even run your program.
Despite writing code for years, I’ve altogether avoided writing code that would benefit from something like this. So instead I’ve been using Rust under the same kinds of constraints as a multi-threaded concurrent application with none of the benefits. So I want to pick something that will have lots of moving parts and a big enough project that has be writing a lot of code.
At the start of the week I just had a vague idea to do something with networked services, so I began thumbing through a book on network programming in Rust from Packt Publishing. After looking at it for a couple days I’ve decided it’s not a very useful book, but I’ve gotten the idea to try to build a network monitoring tool like htop but for network traffic. I’ll get to learn a little bit about how to access low-level networking details with Rust, and learn about how to aggregate that data and render it to the screen.
Before that I wanted to learn as much of Tokio as I could and implement some algorithms from a Distributed Systems textbook I got a few months ago, but I’ve decided that network monitoring will be a more concrete goal and produce a tool I might actually want to use later. Consensus algorithms are probably only useful if you’re building your own database, which I would never want to be on the hook for doing.
Following my general long term goals of focusing on how to use computers better, I’m spending a lot of additional time retooling my computer. Earlier this week I finally got Gnome in a good place where I had a focused task switcher in place and I finally got my Rust plugins for vim mostly working. There’s still a couple of issues where coc.nvim will freeze vim when it proxies out to a command that throws an error, and occasionally the autocomplete will open up a documentation window for reasons I can’t figure out. Then it leaves the documentation window open. Rude.
If those things continue to annoy me I’ll have to deal with them, but for now I’m switching from Gnome to i3wm again and relearning how to use it. It’s a pretty bare-bones environment and doesn’t even provide a way to lock your screen, connect to wifi, restart your computer, or go to sleep when you close the lid.
Despite it not providing an intuitive or learnable interface, when you figure out how to do what you want, it’s pretty rewarding and it’s a very reliable tool for managing the applications you want to use. My last-straw moment in Gnome is that the default screenshot tool doesn’t let you copy a screenshot to the clipboard, which is my staple for making dumb internet jokes. Another screenshot tool I’ve been using is called flameshot, which you for some reason need to invoke from a terminal. If you open it from Gnome’s application launcher, you can only take a screenshot of the application launcher itself… So that’s as good a catalyst as any to dive back into learning a new paradigm for computer UI’s.
Short Term Goals
After the chaos of the first week calmed down, I managed to get some code written on Thursday and Friday, finally getting a decent sense of the landscape for what I can do with network packets in Rust, and late Saturday morning I think I finally figured out the last piece I need for quantifying network bandwidth from it (libpnet documentation is pretty sparse, and assumes you already understand all the details of low-level networking and which bytes in a packet header mean what). For an early version of my project I want to get it printing out a list of addresses and accumulating sums of bandwidth usage. From there I hope I have a good enough foundation for building other kinds of ways to look at that data in curses.
Last week I only met about 1-3 people a day, so I want to do a bit better on that front. I especially want to figure out who is interested in either developer tooling or Rust since that’s what I’m focusing on. I’ve already helped someone a little on an example project in Rust that gave me a chance to teach and also a chance to bang my head against some obtuse compiler errors. We came out ahead but I don’t quite know what the ideal solution was to what we were working on.
First week wasn’t particularly bad, though I could have at least written more code or met more people. Eleven weeks left until I go back to work, though.