Polyglot
Languages Rust
Volume Rust

Rust

A general-purpose, statically typed systems programming language with an ownership-based memory model that guarantees memory safety without a garbage collector. Compiles to native machine code through an LLVM-based toolchain.

Paradigms
imperative · functional
Typing
static
Memory
ownership
Version
1.84
First released
2010

Rust is a general-purpose, statically typed systems programming language whose distinguishing feature is its ownership and borrowing model. Each value has a single owner, and access through references is constrained by a borrow checker that statically verifies the absence of data races and use-after-free defects. The result is a language that occupies an unusual position in the design space: comparable in performance to C and C++, with no garbage collector and no language-level runtime, but with memory safety enforced by the type system rather than by manual discipline. Rust further provides algebraic data types through enum, pattern matching, traits as constrained generic interfaces, and an iterator protocol that supports a substantial portion of functional programming directly in the standard library. Programs are compiled to native machine code through an LLVM-based toolchain.

History

Rust began as a personal project of Graydon Hoare in 2006. Mozilla sponsored development from 2009 onwards as the implementation language for the Servo experimental browser engine. The first stable release, Rust 1.0, shipped in May 2015, alongside a commitment to backward compatibility within the 1.x series. The language defines named editions that permit substantial syntactic and semantic changes while preserving compatibility: Rust 2015 corresponds to the language as of 1.0; Rust 2018 introduced the module-system rework and async/await reservations; Rust 2021 introduced disjoint closure captures and array IntoIterator; Rust 2024 introduced consistent let-else handling and generic associated type stabilisations among other changes. The Rust Foundation, an independent non-profit organisation, took over stewardship of the project from Mozilla in February 2021; the language is now developed by the Rust Project under the Foundation’s governance. Releases follow a six-week cadence; the current version is Rust 1.84.

Hello world

fn main() {
    println!("Hello, world!");
}

Build and execution with the standard toolchain:

rustc hello.rs && ./hello

The conventional workflow uses Cargo, the project manager and build tool distributed with the Rust toolchain:

cargo new hello
cd hello
cargo run

Cargo manages dependencies declared against crates.io, the official package registry, through a Cargo.toml manifest and a Cargo.lock lockfile. The toolchain is installed and updated through rustup, which manages multiple toolchain versions and cross-compilation targets in a single user-level installation. The reference compiler is rustc; the development of an alternative front end, gccrs, integrating with the GCC project, is in progress.