1  Why Rust?

Objective

Provide motivation for why learning Rust is a use of our time. Discuss what Rust is and how it is unique compared to other compiled langauges.

🧠 Think of Rust as “C for people who like error messages that actually help.”

Reasoning

Rust is a programming language that’s fast, safe, and surprisingly friendly to use. Rust turns your code into a standalone program that runs directly on your computer. This makes it much faster and more efficient, similar to languages like C or C++. But where those languages can be hard to use and easy to break, Rust was built to be safer and more helpful.

Rust is especially good at preventing bugs related to memory. There’s no garbage collector in Rust so it is quite memory efficient. Moreover, Rust is designed with the developer in mind. The rust compiler provides error messages that rival—or maybe even surpass—the quality of tidyverse error messaging.

TL;DR

  • R is interpreted. Code runs line by line.
  • R (and Python) are built on C.
  • C is compiled — it builds a binary that runs directly on your machine.
  • Rust is also compiled, like C, C++, Go, Java, and Fortran.
  • These languages are “close to the metal” — fast, efficient, and powerful.
  • Rust matches C++ in speed, but with some key advantages:
    • Memory safety without a garbage collector (unlike Go), thanks to the borrow checker.
    • A great developer experience:
      • Helpful, friendly compiler errors (Tidyverse-level DX).
      • Modern tooling (cargo, rustdoc, rustfmt, rust-analyzer, etc.).
  • Rust is easy to get started with and rewards best practices.
    • We won’t go deep into memory safety or concurrency today
  • Rust uses errors as data, unlike R and C++, Rust does not support exceptions