You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
What is Rust
What is Rust
Rust is a systems programming language focused on safety, speed, and concurrency. It achieves memory safety without a garbage collector, making it unique among modern languages. Rust consistently ranks as the most loved programming language in developer surveys.
A Brief History
- 2006 — Graydon Hoare begins Rust as a personal project at Mozilla
- 2009 — Mozilla officially sponsors the Rust project
- 2010 — Rust is publicly announced; the compiler is self-hosting by 2011
- 2015 — Rust 1.0 is released, establishing a stability guarantee
- 2018 — The 2018 Edition introduces async/await groundwork, NLL (Non-Lexical Lifetimes), and module improvements
- 2021 — The Rust Foundation is established by AWS, Google, Huawei, Microsoft, and Mozilla; the 2021 Edition ships
- 2024 — The 2024 Edition brings further ergonomic improvements
- Today — Rust is used in production by hundreds of companies and has been adopted into the Linux kernel
Unlike languages that evolved from academic research or scripting origins, Rust was purpose-built to solve the problems of writing safe, concurrent, low-level code.
Why Choose Rust?
1. Memory Safety Without Garbage Collection
Rust's ownership system guarantees memory safety at compile time:
- No null pointer dereferences — Rust has no null; it uses
Option<T>instead - No dangling references — the borrow checker ensures references are always valid
- No data races — the type system prevents concurrent mutable access
- No use-after-free — ownership rules prevent accessing freed memory
2. Performance
Rust compiles to native machine code with no runtime overhead:
- Zero-cost abstractions — high-level features compile to efficient machine code
- No garbage collector — predictable latency with no GC pauses
- LLVM backend — benefits from LLVM's mature optimisation passes
- Inline assembly — direct hardware access when needed
3. Fearless Concurrency
Rust's type system makes concurrent programming safer:
- Send and Sync traits — the compiler enforces thread-safety rules
- Channels — message-passing concurrency built into the standard library
- Mutex and RwLock — safe shared-state concurrency with compile-time guarantees
4. Modern Tooling
Rust ships with excellent tooling out of the box:
| Tool | Purpose |
|---|---|
| Cargo | Build system and package manager |
| rustfmt | Code formatter |
| Clippy | Linter with helpful suggestions |
| rust-analyzer | IDE support (LSP) |
| rustdoc | Documentation generator |
| crates.io | Package registry |
How Rust Compares
| Feature | Rust | C | C++ | Go | Java |
|---|---|---|---|---|---|
| Memory safety | Compile-time (ownership) | Manual | Manual (RAII helps) | GC | GC |
| Performance | Native | Native | Native | Near-native | JIT |
| Concurrency model | Ownership + types | Manual | Manual | Goroutines + GC | Threads + GC |
| Null safety | No null (Option<T>) |
NULL pointers | NULL pointers | nil | null |
| Package manager | Cargo (built-in) | None (CMake, etc.) | None (CMake, etc.) | go modules | Maven/Gradle |
| Learning curve | Steep (ownership) | Steep (manual memory) | Very steep | Gentle | Moderate |
Use Cases
Rust is used across many domains:
| Domain | Examples |
|---|---|
| Systems programming | Operating systems, device drivers, embedded firmware |
| Web services | High-performance APIs (Actix Web, Axum, Rocket) |
| WebAssembly | Browser and edge computing (wasm-bindgen, Yew) |
| CLI tools | ripgrep, bat, fd, exa, starship |
| Game engines | Bevy, Amethyst |
| Blockchain | Solana, Polkadot, Near Protocol |
| Cloud infrastructure | Firecracker (AWS Lambda), Bottlerocket (AWS) |
| Databases | TiKV, SurrealDB |
Who Uses Rust in Production?
- Mozilla — Servo browser engine, parts of Firefox
- AWS — Firecracker (microVMs for Lambda and Fargate), Bottlerocket OS
- Google — Android (Rust in the OS), Chromium
- Microsoft — Windows kernel components, Azure IoT Edge
- Meta — Source control (Mononoke), build tools
- Cloudflare — Pingora (HTTP proxy replacing Nginx)
- Discord — Read States service (rewritten from Go to Rust for latency)
- Linux kernel — Rust is an officially supported language for kernel modules
Summary
Rust is a modern systems programming language that guarantees memory safety and thread safety at compile time through its ownership and borrowing system. It delivers C/C++-level performance without a garbage collector, while providing modern tooling with Cargo, a rich type system, and a welcoming community. In the following lessons, we will set up the Rust toolchain and write our first program.