What is Rust written in?
The Rust compiler is written in C, OCaml, Rust, and LLVM (documented). Rust uses a bootstrap chain from Machine Code (documented). Rust is self-hosting.
Relationship Graph
All directly connected languages. Click any node to navigate to its page.
Compiler Implementation
| Language | Confidence | Notes | Source |
|---|---|---|---|
| C | 85% | Early Rust had C components before OCaml bootstrap compiler | Source |
| OCaml | 95% | Original Rust compiler (rustboot) written in OCaml | Source |
| Rust | 98% | rustc is self-hosting since ~2011 | Source |
| LLVM | 95% | rustc uses LLVM as backend | Source |
Bootstrap Chain
| Language | Confidence | Notes | Source |
|---|---|---|---|
| Machine Code | 88% | Rust bootstrap chain starts at machine code level | Source |
Influenced By
- Cyclone — Cyclone's region-based memory directly inspired Rust's ownership system
- ML — ML family influenced Rust's type system and pattern matching
- CLU — CLU influenced Rust's iterator protocol and exception handling
- Haskell — Rust adopted algebraic types and type classes from Haskell
- C++ — Rust influenced by C++'s systems programming model
- Erlang — Erlang influenced Rust's actor-style concurrency model
- Alef — Alef influenced Rust's concurrency model
- Limbo — Limbo influenced Rust's concurrency design
- Scheme — Scheme influenced Rust's macro and metaprogramming system
- Swift — Swift and Rust mutually influenced each other
- Elm — Elm influenced Rust's functional style and error handling
Languages Rust Influenced
- Gleam — Gleam's type system and tooling heavily inspired by Rust
- Zig — Zig influenced by Rust's safety and systems programming approach
- Swift — Rust influenced Swift's memory safety features
- V — V influenced by Rust's safety concepts
Frequently Asked Questions
What language is Rust written in?
Rust is primarily implemented in C and OCaml and Rust and Machine Code and LLVM. See the implementation section above for details and source references.
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.
Evidence Sources
- https://doc.rust-lang.org/reference/influences.html
- https://github.com/iohub/rustboot
- https://github.com/rust-lang/rust
- https://spidermonkey.dev/
- https://vlang.io/
- https://rustc-dev-guide.rust-lang.org/building/bootstrapping/what-bootstrapping-does.html
- https://en.wikipedia.org/wiki/Rust_(programming_language)
- https://gleam.run/
- https://ziglang.org/