What Is Rust?
Rust is a statically-typed, compiled, open-source systems programming language. It began in 2006 as a personal project of Graydon Hoare, was sponsored by Mozilla from 2009, and reached version 1.0 in May 2015. Today it is developed by an open community and supported by the Rust Foundation.
fn main() {
println!("Hello, world!");
}
Rust aims to give you the speed and low-level control of C and C++ while preventing whole classes of memory bugs at compile time. Its defining traits:
- Memory safety without a garbage collector — the compiler tracks who owns each piece of data and when it can be freed. Mistakes such as using freed memory or two threads writing the same data at once are compile errors, not crashes in production.
- Compiled to native code — programs build into a native executable with performance comparable to C and C++.
- Zero-cost abstractions — high-level features such as iterators, generics, and closures compile down to code as efficient as the hand-written low-level version.
- Strong, expressive types — types are checked at compile time, but
the compiler infers most of them, and features like
enumandmatchmake it hard to forget a case. - Excellent tooling —
cargobuilds, runs, tests, and manages dependencies;rustfmtformats code;clippycatches common mistakes. All three ship with the standard installation. - Helpful compiler errors — error messages explain what went wrong and usually suggest a fix.
The price for these guarantees is a steeper learning curve than many languages: you'll spend time early on learning the ownership and borrowing rules that make Rust's safety possible. This course introduces them step by step.