Mutable Closure

On Learning Rust (Coming From Swift)

A year or so ago, I started a more serious effort to learn Rust, which is still ongoing. Despite all the hype, both for and against the language, I'm glad I did.

My background had been primarily in native software development for Apple platforms, which means mostly Swift, Objective-C, and, before that, C/C++.

Getting into Rust felt a bit like learning the very first version of Swift after coming from Objective-C: as if someone had secretly listened to all the coding issues you've ever had and decided to do something about it.

Rust is a love letter to native systems programming, written by people who deeply understand its challenges and pains yet still love it. This feeling permeates every feature and must be why Rust keeps topping the charts as the most admired language.

Swift has the potential to get there, but in recent years, it has been held back by Apple's legitimate business interests leading to more and more ad-hoc features to support the development of its own products. (That said, last year showed some encouraging signs of deeper first-party support for non-Apple ecosystems, which, unfortunately, only adds to the feature count.)

Rust doesn’t have this problem. Even Mozilla, which initially controlled its development, has since transferred control to the Rust Foundation, which has already attracted significant investments from at least two different big tech companies.

I believe Rust is here to stay beyond the hype. But even if it weren’t, it would still be worth learning. It’s not every day that we see a mainstream language popularising completely new paradigms for structuring code. Seminal Rust features like ownership and borrowing - but also Send and Sync types - are being adopted and will continue to inspire other languages in the years to come.

And if you’re old enough to miss thorough and well-written technical books, you’ll be pleased to know that Rust has not just one, but plenty.

Personally, I started with the ubiquitous official book (by Klabnik and Nichols, with contributions from the Rust Community), which provides a solid introduction, as well as Herbert Wolverson's excellent Hands-on Rust, a light-hearted and engaging way to get started with the language.

But as a learner type who craves a deep understanding of a new topic, things really started to click when I picked up a copy of Programming Rust (by Blandy, Orendorff, and Tindall).

Don’t let the page count scare you away - this exceptionally well-written book goes to great lengths not only to explain every feature of the language but also to provide the background on why it exists and why it matters.

Regardless of your preferred learning style, if you haven’t already, I encourage you to give Rust a try. It has helped me reconnect with my passion for programming.