2017-07-31-why-learn-rust.md 4.3 KB


title: Why Am I Learning Rust? tags: rustlang

description: A short note about skills and practice

Professionally speaking, I'm no longer a software developer, and haven't been for a few years[^DBA]. Indeed, my time on the operations side of the aisle has done nothing but increase my preference towards proven, off-the-shelf solutions. Not Invented Here? Great, sign me up!

Yet, I insist on doing things like brushing up on my very rusty Haskell to put together this website (see the "About this blog" section), and, more recently, trying to learn Rust. Why?

Two reasons, really. First, and most important, it's ... well, I was going to say "fun", but I think it's probably better described as "good". I enjoy it, even when it's frustrating. There's a rewarding fulfillment in getting something to work. There's rewarding engagement when something isn't working (at least to a certain point).

Second, and possibly more important than that most important thing, it's good practice. Well, it's good practice when it's good. Actually, let's stop using the word "good", and instead use the word "focused", since I'm really talking about the concept of focused practice.

Since I don't code professionally the way that I used to, I need to keep up some practice just to slow the backslide of losing that skill. That's something that's becoming more present in my mind as I age and watch the skills of my youth atrophy[^atrophy]. And that's fun and rewarding enough, but focused practice is something else. That's when you practice something that you're weak at, with the aim of improving your skill. One way to tell the difference between maintenance pracitce and focused practice is the ratio of frustration to fulfillment -- focused practice usually means much higher amounts of frustration, and more time not feeling like you know what you're doing. That's the point, really.

Learning stuff I already know

Learning Haskell wasn't focused practice for me. I was already familiar with the functional and type-driven aspects of it from my experience with the SML family. Laziness required some work, and purity mostly felt like an inconvenience. I wasn't learning Haskell to become a better programmer, I was learning it for practical reasons; it was the typeful functional language with a community and a future[^ocaml].

Setting up this website was likewise for fun and practical reasons, rather than for improvement. I wanted a website again, and I didn't want a particularly dynamic one, and I thought wrestling with Hakyll would be fun. As it turns out, it was (even if I post infrequently enough to need to check my shell history every time I publish).

Not too long ago, I picked up an old project and tinkered it into a working state. I did some parsing of binary files, and some fancy python generator tricks. I worked with python 3. And none of it was much of a stretch.

Learning stuff I don't

Rust, on the other hand, is a stretch. There may not seem to be much in common between Python and Haskell, but there's one rather big thing: they're both operating at very high levels of abstraction. I don't have to think about how threads work, or the in-memory representation of my data, or any fun stuff like that. It's all taken care of under the covers.

Rust, on the other hand, is really a systems-level language, despite some of its very fancy features. I'm having to become conversant in words like & and * for the first time since school. The intro documentation culminates in building a thread pool library from the thread spawning and message passing primitives available in the standard library.

This is not stuff that I'm good at.

So I'm trying.

[^DBA]: I'm currently a Database Administrator and a manager of DBAs. Hence my occasional article about SQL.

[^atrophy]: Often for the best, to be sure. I'm certain, for example, that my once lauded ability to survive on a diet of Twinkies and warm Coca-Cola is an adaptation that belongs in the past. And, lest you worry, I continue to maintain important skils like dreadful punnery and recalling commercial jingles of my youth.

[^ocaml]: And it was cooler than ocaml. Ocaml also came with the problem that I couldn't help but compare it to SML, all the time.