Rust
Overview
Rust provides memory safety without a GC through ownership, borrowing, and lifetimes—ideal for systems programming, WebAssembly, CLIs, and performance-critical services. The Cargo toolchain, crates.io ecosystem, and strong community docs lower adoption friction.
Key concepts
- Ownership — Each value has one owner; moves vs copies.
- Borrowing — Shared
&Tor exclusive&mut Treferences. - Lifetimes — Compiler-proven reference validity.
Result/Option— Explicit error and absence handling.- Fearless concurrency — Type system catches many data races.
Borrow check (conceptual)
Sample: CLI-friendly function
fn divide(a: f64, b: f64) -> Result<f64, &'static str> {
if b == 0.0 {
Err("division by zero")
} else {
Ok(a / b)
}
}
fn main() {
println!("{:?}", divide(10.0, 2.0));
}
References
- The Rust Book
- Rust by Example
- docs.rs (crate documentation)
- W3Schools — Rust (What is)