Rust is a systems language that gives C-like speed and control without a garbage collector, and rules out whole classes of memory and data-race bugs at compile time. The price is a strict compiler and a new way of thinking about who owns each value. It is used for operating-system parts, network services, command-line tools and WebAssembly.
Key concepts
- Ownership: each value has one owner; when the owner goes out of scope, the value is dropped.
- Borrowing and lifetimes: references are checked so they never outlive what they point to, and mutable access is exclusive.
- Enums and pattern matching: data that is one of several shapes, handled exhaustively.
- Option and Result: absence and failure are values in the type, not null or exceptions.
- Traits and generics: shared behaviour without inheritance, resolved at compile time.
- Safe and unsafe: the compiler guarantees safety in ordinary code; unsafe blocks mark where you take over.
Vocabulary
- Borrow checker: the compiler phase that enforces ownership and borrowing rules.
- Crate: a unit of compilation and distribution; the package manager is called Cargo.
- Trait object: a value used through a trait, with dynamic dispatch.
- Fearless concurrency: the type system rejects data races in safe code.
What to study, in order
- The language's own introductory book, chapter by chapter, typing every example.
- Ownership and borrowing: write functions that fail to compile and read the messages.
- Structs, enums, pattern matching, Option and Result in a small command-line tool.
- Traits and generics; implement standard traits for your own types.
- Threads and channels, and why the compiler refuses shared mutation.
- Read and write a small amount of unsafe code and its safe wrapper.