Rust

Definition

Rust is a compiled, systems programming language designed by Mozilla

  • License: Dual licensed under MIT/Apache-2.0
  • Runtime: Compiles directly to machine code (LLVM backend)
  • Creator: Graydon Hoare at Mozilla expressions
  • Zero-cost abstractions: High-level features compile to efficient machine code
  • Fearless concurrency: Compile-time guarantees against data races

Key Concepts

Concept Description
Ownership Each value has one owner; transfer on assignment
Borrowing References (&T, &mut T) with lifetime rules
Lifetimes Compile-time tracking of reference validity
Traits Similar to interfaces; define shared behavior
Enums with data Algebraic data types with associated values
Result type Explicit error handling with Ok/Either pattern

Tooling

Tool Purpose
cargo Build tool and package manager (like Maven for Java
rustc Compiler
rustfmt Code formatter
clippy Linter
rustdoc Documentation generator

Major Versions

Version Year Key Features
Rust 1.0 2015 Stable release
Rust 1.30 2018 async/await (experimental)
Rust 1.36 2019 async/await (stable)
Rust 1.39 2019 match-arms
Rust 1.53 2021 Const generics
Rust 1.65 2022 match-arms
Rust 1.70 2023 pattern-matching
Rust 1.75+ 2023-2024 async-closures, const-generics

Use Cases

  • Operating systems (Redox OS, linux kernel modules)
  • WebAssembly (Wasm) modules
  • Embedded systems and IoT
  • Blockchain (Solana, Near)
  • Browser components (Firefox, Chromium)
  • CLI tools and system utilities