Skip to content

What Rust Is Actually For

Here’s the gap in almost every Rust tutorial. They teach you the borrow checker in exhaustive detail and never once tell you what people build with it — or why they chose Rust over Go, C++, or TypeScript. So you finish knowing the syntax and still can’t answer the only question a hiring manager, or your own ambition, actually asks: what is this language for?

This chapter answers that. Then the rest of the book has you build one thing that lives in the middle of that landscape.

Every other language makes you pick two of three: fast, safe, no runtime. C and C++ are fast with no runtime, but memory-unsafe — a single dangling pointer is a security vulnerability. Go, Java, and TypeScript are safe, but buy that safety with a garbage collector that pauses your program at unpredictable moments. Rust is the language that refused the trade: C-level performance, memory safety proven at compile time, and no garbage collector — the borrow checker you fought in the base playbook is the price, and this is what you bought with it. Add fearless concurrency (data races are compile errors) and you have the one-paragraph pitch for every system below.

no GC / bare-metal speed
C, C++ │ Rust ◀── keeps both, adds safety
│ ●
───────────────────────────┼───────────────────────────▶ memory-safe
│ ●
(none)│ Go, Java, C#, JS
│ (safe, but a garbage collector)

The heartland. Proxies, load balancers, databases, message queues, runtimes — the software that other software runs on, where predictable low latency and no memory bugs are worth a steeper language.

  • Cloudflare Pingora — a Rust HTTP proxy framework that replaced their nginx fleet, now serving well over a trillion requests a day with less CPU and memory. This is the “Cloudflare routing system” you were thinking of — and it’s the closest cousin to what you’ll build here.
  • Databases & data planes — TiKV (the CNCF key-value store behind TiDB), InfluxDB 3’s engine (IOx), Materialize, Neon, and vector DBs like Qdrant are all Rust.
  • AWS Firecracker — the microVM that boots in ~125 ms and isolates every AWS Lambda and Fargate workload. Written in Rust specifically so a multi-tenant hypervisor can’t be memory-corrupted.

2. Performance-critical services (killing tail latency)

Section titled “2. Performance-critical services (killing tail latency)”

The most common “why we switched” story: a service was fine on average but had ugly p99 latency because of garbage-collection pauses. Rust removes the GC, so the tail flattens.

Rust compiles to a single static binary with no runtime — nothing to install, instant startup, and it’s fast. That combination has quietly taken over modern CLI tooling.

  • ripgrep (rg), fd, bat, eza — the fast replacements for grep/find/cat/ls.
  • ruff and uv (from Astral) — a Python linter and package manager, both in Rust, both 10–100× faster than the Python tools they replace. Biome does the same for JS/TS.
  • Your own logwise and askr from the base playbook live here.

Rust is the best-supported language for WASM — compiling to a sandboxed, near-native module that runs in the browser or at the edge. 1Password ships its Rust core to the browser as WASM; edge platforms (Cloudflare Workers, Fastly) lean on Rust/WASM for user code. If you want to put fast, safe logic inside a frontend or an edge runtime, Rust is the path.

No garbage collector and no runtime means Rust can go where managed languages can’t: the bare metal.

  • The Linux kernel now accepts Rust drivers (merged in 6.1). Android and Windows are both rewriting memory-sensitive components in Rust to kill the ~70% of security bugs that come from memory unsafety.
  • Embedded firmware, real-time systems, and #![no_std] targets with no OS at all.

Where correctness and performance are non-negotiable and a bug can cost real money. Solana’s validator and its on-chain programs are Rust; so are Polkadot/Substrate and NEAR. This is the category your own goal lives in — and the base playbook’s Phase 2 (btcminiethminisolmini) was your on-ramp to it.

DomainWhat gets builtReal examplesWhy Rust wins
Infra / proxiesrouters, load balancers, gatewaysCloudflare Pingorano GC pauses, memory-safe, low overhead
Databasesstorage & query enginesTiKV, InfluxDB IOx, Qdrantpredictable latency, control over memory
Runtimes / VMslanguage & VM runtimesDeno, Firecrackersafety in a trusted, multi-tenant core
CLIs / toolingdev tools, lintersripgrep, ruff, uvone fast binary, instant startup
WASM / edgesandboxed modules1Password, edge workersbest-in-class WASM target
OS / embeddedkernels, firmwareLinux, Android, Windowsbare metal, no runtime, safe
Blockchainvalidators, contractsSolana, Polkadotcorrectness + performance under money

A senior engineer is known as much by what they don’t use Rust for. Reach for something else when:

  • You’re still discovering the product. Churny business logic that changes weekly pays a tax in Rust’s compile-time strictness. A GC language lets you move faster while the shape is unknown.
  • The bottleneck is I/O or the network, not the CPU. If you spend 200 ms waiting on a third-party API, rewriting the 2 ms of glue around it in Rust buys you nothing.
  • The team doesn’t know Rust and the deadline is tight. The borrow checker is a real ramp; don’t put it on the critical path of a two-week launch.
  • It’s simple CRUD glue. If a boring Go or TypeScript service is fast enough and easy to hire for, “fast enough” wins. Rust earns its keep at the hot path, not everywhere.

The app you’re about to build is deliberately planted in categories 1, 2, and 6’s neighborhood: a Rust service (infra), on a hot request path you’ll profile and flatten (performance), fronted by a web UI and fed by AI. It’s a microcosm of a real production system — small enough to hold in your head, complete enough that every layer you add is a layer you’d add at work.

Next: Part 1 · The Blog Core → — we run cargo new and start building.

  1. Rust “refused a trade-off” that other languages accept. What are the three properties, and which one does each of C++ and Go give up?
  2. Discord moved a service from Go to Rust and a specific problem disappeared. What was it, and what was the root cause the rewrite removed?
  3. Cloudflare Pingora and AWS Firecracker are very different products. What single Rust property is the reason both chose it?
  4. Give one concrete situation where reaching for Rust would be the wrong call, and say why.
  5. Which of the six domains is closest to your Solana/Anchor goal, and which base-playbook projects were the on-ramp to it?
Show answers
  1. Fast, memory-safe, and no runtime/GC. C++ keeps fast + no-runtime but gives up memory safety (dangling pointers, buffer overflows). Go keeps safe + fast-ish but gives up “no runtime” — it ships a garbage collector. Rust keeps all three, paying with compile-time strictness (the borrow checker) instead.
  2. Latency spikes on the tail (p99). The root cause was Go’s garbage collector doing stop-the-world pauses every couple of minutes; no amount of tuning removed them. Rust has no GC, so there’s nothing to pause — the spikes vanished rather than shrank.
  3. Memory safety without a garbage collector. A proxy serving a trillion requests and a hypervisor isolating multi-tenant VMs both need C-level performance and an ironclad guarantee that untrusted input can’t corrupt memory. Rust is the language that offers both at once.
  4. Any of: prototyping a product whose shape is still changing (strictness slows iteration); an I/O-bound service where the CPU work is trivial (Rust optimizes the wrong thing); a team without Rust experience under a tight deadline (the borrow-checker ramp is on the critical path); or plain CRUD glue where a GC language is already “fast enough” and easier to hire for.
  5. Blockchain & crypto systems (domain 6) — Solana’s validator and on-chain programs are Rust. The on-ramp was the base playbook’s Phase 2: btcminiethminisolmini.