After years of using CLI tools and Python libraries implemented in Rust, I wanted to learn what all this Rust fuss is about. I have much respect for the performance and stability of the Rust programs I use (such as the Helix editor, the Ruff and uv Python tools), I had heard intriguing things about the language, and at first glance I had failed to understand the little Rust code I had read.
Also frustrations with the programming languages I use every day (Python and TypeScript) motivated me to take a look at something different; albeit very different in this case, because Rust is oriented towards system programming.
So time to learn Rust. I opted for the old-fashioned way: reading the Rust Book and doing the Rustlings exercices alongside.
Here are some general notes and impressions I got from learning Rust (still ongoing):
- It can be seen as primarily imperative, but the data flow focused on immutability and the functional features make it feel elegant and well thought.
- Abstractions via generics and traits are just as much object-oriented programming as you want for such a low-level language.
- Ownership concepts are central to gorking the language, however they are really approachable and explain much of the power behind Rust.
- When it compiles, it means the data flow is good and robust and that the runtime will work exactly as intended in the best way possible.
- This means that, yes, it’s complex to implement anything in Rust because we must tell the compiler everything we want to do, but successful compilation gives great assurance about the program quality.
- The type system allows avoiding many checks at runtime.
- Pattern matching is a very important feature: almost everything about branching (via enums), error handling (via Result) and absent values (via Option) use pattern matching; it avoids lots of bugs.
- You need significant experience to be fluent in the language and easily translate what is on your mind into code.