The language
A compiler that keeps the memory rules.
Rust is a compiled language for programs that have to be fast and have to stay standing. The lessons teach the syntax. This page is the reason the syntax looks the way it does.
Origins
Graydon Hoare began Rust in 2006. The name is the rust fungus, chosen because a robust thing can look weathered and still hold. Mozilla started sponsoring the work in 2009. Firefox was a large concurrent C++ program, and memory mistakes in that kind of program become security bugs.
The language was rewritten more than once before it settled. Ownership, borrowing, and the borrow checker are the result of that decade: the compiler, not the programmer's memory, decides when a value is still allowed to be used.
Rust 1.0 shipped on 15 May 2015, with a promise that code which compiled then would keep compiling. Later editions — 2015, 2018, 2021, and 2024 — change the surface of the language without breaking old crates. The programs in Ferrugo are edition 2024.
An experimental browser engine called Servo was written in Rust and fed real code back into Firefox, including the Stylo CSS engine. In February 2021 the Rust Foundation took up stewardship of the language, the compiler, and crates.io. The founding members were AWS, Google, Huawei, Microsoft, and Mozilla. The language had already left the building it started in.
Beside other languages
Rust shares habits with languages you may already know, and it refuses several of their conveniences on purpose.
| Rust | Python | JavaScript | Java | |
|---|---|---|---|---|
| Types | Checked before the program runs | Decided as the program runs | Dynamic. TypeScript checks, then erases the types | Checked before the program runs |
| Memory | Freed when the owner ends. No garbage collector | Garbage collected | Garbage collected | Garbage collected, on a virtual machine |
| Absence and failure | Option and Result | None and exceptions | undefined and exceptions | null and exceptions |
| Runs as | Native code, or WebAssembly | An interpreter, or a bytecode virtual machine | A browser, Node, or another JS engine | The Java virtual machine |
Python
Both reward a program you can read. Python gets there with dynamic types and a vast library for scripts, data, and glue. A wrong type usually appears when that line runs. Rust gets there by refusing to build until the types, the owners, and the borrows agree. Python is the faster first draft when the program spends its time waiting. Rust is the tighter program when the work is the CPU, the memory, or a bug you cannot afford later.
JavaScript
Both have a large package culture, npm and crates.io, and both can describe work that waits. JavaScript is the language of the page. It is dynamic, and a collector reclaims memory. TypeScript adds types and then removes them: what runs is still JavaScript. Rust compiles to native code, or to WebAssembly when a page needs it. Many JavaScript tools are now written in Rust because the tool has to be fast. The page they produce is still JavaScript.
Java
Both are statically typed and meant for programs that live for years. A Java interface and a Rust trait both name behavior a type can promise. Java runs on a virtual machine. Almost any reference can be null, and failure is often an exception. Rust runs as native code. Absence is Option, recoverable failure is Result, and the borrow checker rejects many data races before the program starts. A team with a large Java codebase will often ship sooner by staying there. Rust pays that time back when the program needs a smaller memory footprint, steadier latency, or the control of C without C's silent mistakes.
Why someone reaches for it
People choose Rust when the cost of being wrong in production is higher than the cost of a slower first draft.
- The program needs the speed and the small memory use of C or C++, and the compiler should hold the memory rules.
- A mistake would be a crash, a security hole, or a latency spike, and it is cheaper to hear about it at build time.
- The process should run for a long time without garbage-collection pauses.
- One toolchain should behave the same on every machine: rustup, cargo, and crates.io.
A script, a notebook, or a page of interface code is usually happier in Python or JavaScript. Rust is the language for the part of the system that has to be correct and fast at the same time.
Where it has a following
The following is in systems work, in the tools other languages run on, and among developers who keep choosing it.
- Operating systems. Rust is accepted in the Linux kernel for drivers and other new code. Android uses it for new native code, and Google has described a sharp drop in memory-safety vulnerabilities as that shift took hold. Microsoft uses it in parts of Windows and in other systems work.
- Infrastructure. AWS wrote Firecracker, the microVM behind Lambda and Fargate, in Rust, and Bottlerocket, a container-oriented OS, as well. Cloudflare's Pingora proxy, which fronts a large share of its traffic, is Rust. Discord rewrote a busy service from Go to Rust to steady its latency.
- Browsers. Firefox runs Rust in its CSS engine and in other components that grew out of Servo.
- Tools. ripgrep searches files. In the Python world, ruff and uv are Rust. In the JavaScript world, SWC and Turbopack are Rust. cargo and the compiler are Rust too.
- Small machines and the web. Embedded work and WebAssembly use Rust where a garbage collector does not fit.
For years Rust has led Stack Overflow's ranking of languages developers most want to keep using. That is a following among people who write it, separate from any one company.
Start with main when you want the syntax those systems are written in.