Is it time to finally learn Rust?

I like C++, and tooling has come a long way, but it’s so much easier to download rust/Python/node and you’re basically set on every platform & immediately ready to go. NOW consider pay, and even someone enthusiastic about programming C++ will reconsider.

-- https://news.ycombinator.com/item?id=33436268

I spoke to one programmer friend. He is skilled in R, experienced in NeoVim and Nix.

What is one language he would love to learn?

Rust.

I spoke to another programmer, skilled in C++ and Python, with a background in Computer Science.

One language he has long been wishing to learn?

Rust.

I talked with a programmer from my company. He chose Haskell as the language for an important production-grade tool he was working on. Although Haskell was uniquely suitable for the type of the task (translation between complex rule sets), at the time it seemed as a wise, future-proof choice also in a larger context.

Does he still see Haskell as the language to learn and use? Nope.

What language does he have the most hope for then?

Rust.

You can write Linux drivers in Rust now [1]:

[Fabien] Parent became interested in Rust after stumbling across a sample GPIO driver in Rust on LWN.

Other parts of the kernel are also accumulating Rust code [^rust_kernel]:

Parts of Firefox have been migrated to Rust in the process of making them more secure, including guarding against memory errors [2]:

In 2012, Mozilla launched a new project called Servo to write a completely new and experimental browser engine utilizing memory safe techniques written in Rust. In 2018, Mozilla opted to integrate parts of the Servo project into the Gecko engine in a project codenamed the Quantum project.

One question you may hear in your head before you decide on giving Rust a try is:

All the hype is on ML and AI right now. Why learn anything not strictly related to AI?

This is a reasonable question to ask. I haven't yet heard anyone bragging about Rust being used for ML. Even for Haskell, I have, and Haskell is a very niche and experimental language.

I think this sums up Rust and ML quite well [3]:

I’m writing code in Rust for atomistic machine learning (used in research to run simulations of atoms/molecules/crystals). But only our lower level libraries are in Rust, we do all the exploratory stuff in Python, calling into these low level libraries. PyTorch is just too good, and using GPUs from Rust too clunky for now.

That means Rust will probably not be your first choice for ML even when you thoroughly learn that language.

Still, in case you ever need to write some low-level logic to be called from your Python or Julia scripts for performance reasons [4], Rust may be a much better ecosystem to use than C or C++.

It's time to give Rust a try.

I'll be using the course by Stephen Grider [5] (link includes a coupon code).

Let's learn together!


  1. https://lwn.net/Articles/970216/ ↩︎

  2. https://en.wikipedia.org/wiki/Firefox#Security ↩︎

  3. https://www.reddit.com/r/rust/comments/13eij5q/comment/jjsfxe3/ ↩︎

  4. Yes, Python-nogil is coming and it solves a lot of problems. ↩︎

  5. https://www.udemy.com/course/rust-the-complete-developers-guide/?couponCode=C6DE0A720-DISCORD ↩︎