Rust for the Brave and True

thinkpad and linux

A few years ago, I wanted to make the switch from Frontend to Backend. One day I fell down the YouTube rabbit hole and (partly) watched a few tech talks. I realised that many of the really good talks were held at Clojure conferences. I looked into it, and decided to learn Clojure.

The lust for learning a new programming language often times comes from the sheer boredom of your old work, so you also want to redo part of yourself. After a bit of research, I found the book called “Clojure for the Brave and True”, and absolutely loved it.

After a few weeks however, I gave up. The book wants you to jump all in and learn emacs at the same time as well, since it provides, according to the book, the best environment. I really liked the idea, but abandoned the project also due to the lack of Clojure positions for Juniors in my area (Berlin, Germany).

Rust

A few years later, today, I started to learn Rust and got excited about the whole ecosystem, community and possibilities. I read, wrote and programmed a lot in Rust during the last few months. So much so that I got a Rust position at a company starting August (yay!).

Brave

But, as I digged deeper and deeper into the language, and watched tutorials, I figured: I can’t do Systems Programming on a MacBook Pro running macOS. Don’t get me wrong: Once you mastered a skill, it doesn’t matter where you operate it on. Also a different machine doesn’t make a huge difference.

Although, I might disagree a bit with that. Take loosing weight for example. Just cutting down a few kcal per day won’t make a huge difference. Your fridge has to look completely different so you are less tempted to eat all the bad things and naturally will nurture your body in a more healthy way.

I remembered the “Clojure for the Brave an True” concept, and wanted to apply it to my Rust environment

This is exactly what I aimed for when I ordered a Thinkpad X1, with the intention to install Arch Linux on it. Instead of nurturing my body, I wanted to nurture my brain in the right way. If I want to learn about TCP/IP for example, I don’t want to brew install the right package every now and then.

My reasons:

True

vim and Rust on Arch on a Thinkpad X1

After receiving my Thinkpad, I removed Windows and installed Arch from a USB stick, following these steps. After 4 tries I finally succeeded. When I booted the first time, I installed i3 and alacritty as my terminal. Next to this, I installed Firefox for browsing. That’s it. I need a terminal, a window manager and a browser. I barely touch my mouse any more.

What I learned from it

Working under macOS, I constantly opened other programs while I didn’t know how to proceed on a task. With Arch, it’s much harder to do so (and less fun). I have a physical notebook instead next to me and I will, if I can’t proceed on a problem, note down my thoughts in the notebook and stare out of the window to think again.

I am excited again to be closer to the hardware I operate on. Being able to master nvim and setup a proper tmux setup is so much faster then doing the same workflow inside Visual Code or other editors.

Rust Coding Environment

I am using:

With the following PlugIns for NeoVim:

That’s it. You can easily setup a tmux session, split the window where you have your code inside nvim and on the other half of the window cargo run/watch.

Moving through code like that makes it really hard after a while to use a normal code editor again. Allthough you can install vim bindings to VS Code I guess.

2 Warnings/Hints

Additions

In addition to the Thinkpad, I got a vertical mouse and a proper keyboard. Both of which even increase the fun of my setup. My monitor is a Dell 4k 27” which is hooked up on a monitor stand.

This is so nice to work with that I even don’t miss the beautiful 5k LG UltraFine at all, which I previously had.

Summary

I provide the basic dotfiles and steps for my setup on my GitHub account. It’s good to run contrary to certain environments. The iPad for example became so powerful that the casual user doesn’t need a Notebook anymore to do every day tasks. That’s a perfect time to reconsider your relationship with your tools you are using.

If you follow the steps, it’s really simple to operate within Arch on a Thinkpad. You need to tinker with HDPI here and there, and adjust some hibernate functionality. But overall it’s what I wanted: The bare minimum to get to a comfortable coding environment, with almost no distractions.

In the end, the Thinkpad also has a much better keyboard than the MacBook Pro. Also the form factor is just perfect. A bit bigger than the 13” and smaller than a 15” model.