Programming language · 2010

Rust

Memory-safe programming language without garbage collection.

Official site ›
Rust logo
C, OCaml, Rust, Machine Code, LLVMWritten in
2010First released
MozillaDeveloper
staticTyping
Apache Software License 2.0 and MIT LicenseLicense
Built fromInfluenced Rust COCamlRustMachine CodeLLVMCycloneMLCLUGleamZigMoveSwiftVPony
CompilerBootstrapInfluence
ReplacedC and C++ where memory safety matters
Being replaced byStill ascending; no clear successor

What is Rust written in?

Rust is self-hosting: the official compiler, rustc, is written in Rust. Early Rust used an OCaml compiler, and modern rustc uses LLVM as its backend.

What Rust is used for

Rust targets systems programming where safety and speed both matter: operating systems, browsers, command-line tools, WebAssembly, and performance-critical services. Its ownership model prevents whole classes of memory bugs without a garbage collector.

Notable software: parts of Firefox, the Deno runtime, the ripgrep and fd CLI tools, and components inside Windows, Android, and the Linux kernel.

About Rust

Rust is a memory-safe programming language without garbage collection. It is a statically typed language that compiles ahead of time to native machine code. It supports systems, imperative, and functional programming.

Rust first appeared in 2010 and was designed by Graydon Hoare at Mozilla. Rust has a large, active user base today.

Rust in the language family tree

Rust drew on ideas from Haskell, C++, Cyclone, CLU, and Alef and went on to influence V, Gleam, Zig, Swift, Pony, and Move.

Sources: Wikipedia · Wikidata · Official site

Quick Facts

Short answer
rustc is written in Rust
Original compiler
OCaml
Backend
LLVM
Bootstrap status
Self-hosting since 2011

The OCaml origin and bootstrap transition

Rust did not start self-hosted. Graydon Hoare began the language in 2006 as a personal project while working at Mozilla. The first compiler, known informally as rustboot, was written in OCaml. OCaml was a pragmatic choice for a language researcher: it has a powerful type system and pattern matching that suited the rapid experimentation Rust required in those early years.

Mozilla began sponsoring the project in 2009. By that point the team was designing Rust's ownership and borrowing rules, a type system complex enough that the OCaml compiler would have become a maintenance burden: OCaml developers on the team were limited, and writing the compiler in the language being designed is the strongest possible end-to-end test of its expressiveness.

The transition happened incrementally. The team first rewrote rustboot in Rust while keeping OCaml as the compilation host. Once that Rust-in-Rust compiler could compile itself, the OCaml dependency was dropped. By 2011, Rust was self-hosting: every new rustc release is compiled by the previous release. This is the standard self-hosting bootstrap: a stage-0 binary (the prior release) compiles stage-1 from the current source, stage-1 compiles stage-2, and stage-2 must be byte-for-byte identical to stage-3 to confirm the toolchain is internally consistent.

rustc compiler architecture

rustc is a multi-stage compiler with several distinct intermediate representations. Source code is parsed into an abstract syntax tree (AST), then lowered to HIR (High-level Intermediate Representation), where type inference and trait resolution run. HIR is then lowered to MIR (Mid-level Intermediate Representation), which is the layer where the borrow checker operates. MIR's explicit control-flow graph makes liveness analysis and borrow-checking tractable.

After MIR, rustc lowers to LLVM IR and calls LLVM for machine-code generation. LLVM provides target support for x86-64, ARM, RISC-V, WebAssembly, and other platforms. The decision to use LLVM from the beginning let rustc focus on language semantics rather than code generation, and gave Rust access to decades of LLVM optimization work.

A second backend, Cranelift, has been available since Rust 1.67 as an opt-in alternative for debug builds. Cranelift compiles faster than LLVM at the cost of less optimized output, which speeds up the inner loop of Rust development. Cranelift is also the JIT backend for Wasmtime. The long-term goal is to use Cranelift for debug builds and LLVM for release builds.

mrustc: an alternative bootstrap path

mrustc is an independent Rust compiler written in C++. Unlike rustc, mrustc does not aim to be a general-purpose production compiler. Its purpose is security: it can compile an early version of rustc without relying on a pre-built rustc binary, breaking the binary dependency chain that concerns reproducible-build advocates.

The Bootstrappable Builds project highlights the risk that a malicious binary compiler could inject hidden code into programs it compiles, including future compilers, in a way that no inspection of source code would reveal. This is Ken Thompson's "Trusting Trust" attack. mrustc provides a path from C (which has diverse compilers like GCC and Clang to cross-check each other) to Rust without trusting a Rust binary of unknown provenance.

In practice, most Rust users rely on the rustup toolchain manager, which downloads pre-built binaries from the official Rust release infrastructure. mrustc is relevant to distributions and organizations that require a fully source-audited build chain.

Rust implementation layers

LayerWritten inWhat it does
rustc frontend (parser, HIR, MIR, borrow checker)RustParses, analyzes, type-checks, and borrow-checks Rust source
LLVM backendC++Optimization and machine-code generation for release builds
Cranelift backendRustOptional fast debug-build backend; also powers Wasmtime
rustboot (historical)OCamlOriginal compiler before Rust became self-hosting (2006 to 2011)
mrustcC++Independent compiler for security-audited bootstrap chains
Rust standard libraryRustcore and std, including allocator, collections, I/O, and threading

Rust release history and edition system

Graydon Hoare started Rust in 2006 as a personal project. Mozilla sponsored the project from 2009. Rust 0.1 shipped in January 2012. The language went through extensive design iteration during those years: early Rust had typestate, a different memory model, and a green-threading runtime, all of which were removed before 1.0.

Rust 1.0 was released on May 15, 2015. It committed to stability: code that compiled under Rust 1.0 would compile without modification under all future Rust 1.x releases. Rust has shipped a new stable release every six weeks since 1.0, and that cadence has been maintained without interruption.

The edition system manages language evolution without breaking the stability promise. An edition is an opt-in compatibility boundary: code in Rust 2015, 2018, and 2021 editions can coexist in one crate graph, and rustc compiles them all. Editions allow the language to change syntax without forcing every crate to update at once. The 2018 edition made the module system cleaner and introduced the async keyword. The 2021 edition updated closure captures and improved the prelude. Rust 2024 was stabilized in 2025.

The Rust Foundation was established in February 2021, with AWS, Google, Huawei, Microsoft, and Mozilla as founding members, to own the Rust trademark, run the infrastructure, and fund core team contributors. Rust has since been adopted by the Linux kernel (support landed in Linux 6.1 in December 2022), the Windows kernel, Android, and major cloud providers.

Frequently Asked Questions

What language is Rust written in?
Rust is self-hosting. The official Rust compiler, rustc, is written in Rust. The first Rust compiler was written in OCaml, and modern rustc uses LLVM as its backend.
What languages influenced Rust?
Rust was influenced by Haskell, C++, Cyclone among others. See the influence section above for the full list.
Which languages did Rust influence?
Rust influenced V, Gleam, Zig among others.
Is Rust self-hosting?
Yes, Rust is self-hosting, its compiler can compile itself.
When was Rust first released?
Rust was first released in 2010. It was designed by Graydon Hoare.

Evidence Sources

Discover More

Embed this graph

Paste this iframe into any HTML page to show the Rust relationship graph.

<iframe src="https://www.languagelineage.org/embed?lang=rust" width="100%" height="500" loading="lazy" style="border:0" title="Rust relationship graph"></iframe>

Please attribute the visualization to Language Lineage and link to the Rust source record.

Explore Rust in Graph →