medium.com 15 min read Original Source

Why Is Everything Written in Rust Now?

I was at my desk at work, waiting on a script, when I noticed my toolchain had changed languages underneath me. The script was running through pixi, which is written in Rust. The environment it ran in came from uv, also Rust. I reached for ripgrep to find a function in a codebase I barely knew, and it returned before I finished leaning back in my chair.

And it isn’t only my desk. Solid 2 ships a compiler toolchain written in Rust on top of Oxc, benchmarked somewhere between 20x and 350x faster than the JavaScript compiler it replaces. Bun spent eleven days rewriting half a million lines of itself into Rust. The Linux kernel formally accepted Rust support. Vite is swapping the bundler underneath your build from JavaScript to Rust. And Debian is putting a hard Rust dependency inside APT, the package manager sitting under a good fraction of the servers you have ever logged into, with the four architectures that lack a working Rust toolchain given six months to catch up or be sunset. At this point, I might as well write this article in Rust. 🤣

At no point did I decide any of this. One tool replaced another, a library swapped out under a familiar command, and the defaults of my working day switched languages without asking me first.

Which is worth sitting with for a second, because this is not a fad cycle. I started pulling on the thread for this piece and found what might be the largest coordinated migration software has ever attempted, and the deeper I got, the less it looked like a story about a language.

I’m getting ahead of myself. Let’s start with the bug class, because everything we are about to discuss hangs off it.

I used to write the code this movement is retiring

Memory safety is a narrow, unglamorous guarantee: a program cannot read or write memory it doesn’t own. When a C or C++ program walks past the end of an array, or keeps using a chunk of memory after giving it back to the system, you get the bug families with the famous names. Buffer overflows. Use-after-free. They’re not logic errors; the program does exactly what it was told. They’re permission errors the language never checks.

I spent much of my early career in that world. At a startup called Pathware I wrote the Fourier ptychography algorithm for a computational microscope, which is a technique that takes a stack of low-resolution images captured under different illumination angles and reconstructs a single high-resolution one out of them. Building a custom microscope means an enormous amount of complicated linear algebra, more of it than I expected going in, and the parts that actually caused chaos were rarely the parts I would have guessed. The math mostly behaved. The memory mostly did not. We hit memory-safety problems constantly and resolved them by hand, one at a time, which is simply what you did. I don’t remember thinking of it as a language problem at the time. Later, at The Aerospace Corporation, different domain, C++ again.

You accepted manual memory management as the price of speed, and you told yourself you were careful. Everyone told themselves they were careful.

Then the platform owners published their numbers. Microsoft and Chrome both reported that roughly 70% of their serious security vulnerabilities were memory-safety bugs. Not obscure ones. The majority. That one statistic became the north star for the security community, because it reframed the situation: memory unsafety stopped being a craftsmanship problem and became a measurable, budgetable liability.

Android is the cleanest experiment we have. Google started writing new Android code in Rust while mostly leaving the old C and C++ alone. Memory-safety issues fell from 76% of Android’s vulnerabilities in 2019 to 24% in 2024. No heroic rewrite. Just a different default for new code, and the old bugs aged out as the old code stopped being touched.

Underneath that headline are numbers I still don’t fully know what to do with. Android’s Rust code carries roughly a thousandth the memory-safety vulnerability density of its C and C++, which is about what you’d hope for. Rust changes also get rolled back around a quarter as often, and they spend 25% less time in code review. That last one I keep chewing on. The language with the reputation for fighting you produces changes that reviewers apparently argue about less, and I have theories about why but none I’d defend in public.

The bottom of the stack went first

The Linux kernel ended Rust’s experimental status in December 2025, and GPU drivers and core infrastructure are landing in mainline now. For a project that spent two decades saying no to C++, that is a remarkable door to walk through.

Ubuntu went further down the stack than I expected. 25.10 shipped sudo-rs, a Rust rewrite of sudo, as the default. The first major distro to do it. There’s a tool called oxidizr whose whole job is swapping GNU coreutils for the Rust uutils versions, aimed at Ubuntu 26.04 LTS. The commands under your fingers, ls and cp and sort, are the migration now. I don’t know whether that lands on schedule. Nobody outside Canonical does. But nobody builds a tool called oxidizr halfheartedly.

The same swap is happening further out from the core, mostly without press. youki runs containers where runc used to. Arti is a fresh Tor implementation. rustls sits where OpenSSL sat, ntpd-rs keeps the clock, and fish rewrote its entire shell. That last one is why I said your shell up top; if you use fish, you have been running Rust for a while without being told. As for how complete any of this is, uutils sits at 92.2% test parity with GNU coreutils as of early 2026.

Microsoft is doing the version of this that only Microsoft would: porting win32k graphics code to Rust, with GDI region code already shipping inside Windows, and rewriting SymCrypt, the crypto library, with formal verification on top. Crypto and font parsing are exactly where you’d start if you were triaging by blast radius.

And your build tools got there before you did. In Python, uv pulls around 126 million monthly downloads and was the most-admired technology in the 2025 Stack Overflow survey, which is a sentence I never expected to type about a package installer, of all things. We used to argue about pip for sport. OpenAI announced on March 19 that it’s acquiring Astral, the company behind uv and ruff. On the JavaScript side, Vite 8 swapped its internals for Rolldown and Oxc, both Rust, with builds running 10 to 30 times faster. If you write Solid or Vue or Svelte, your framework never changed languages, but the entire path your code takes to production did.

Bun is my favorite data point because it’s the messiest. In May, the Bun team announced they had rewritten their 535,000 lines of Zig into Rust, using 64 parallel Claude instances to push 6,778 commits in eleven days. Memory usage after 2,000 builds dropped from 6.7 GB to 609 MB. Andrew Kelley, Zig’s creator, called the result “unreviewed slop.” Meanwhile the Rust build stayed a parallel experiment with no ship date attached to it. Both of those matter. The rewrite happened at a speed that should not be possible, and three months on, the binary you install is still the Zig one.

There’s a deadline under all of this

What moves kernels and crypto libraries is procurement, funding, and eventually liability. Liability is the one that concentrates minds fastest. Once the stakes are national security and corporate exposure measured in billions, “it’s too hard to rewrite” stops being an answer anybody accepts.

In early 2024 the White House’s Office of the National Cyber Director made the case, in plain federal prose, for getting critical software off memory-unsafe languages. ONCD writes national cybersecurity strategy; it does not enforce anything, which is worth knowing before you weigh how much that document mattered. Then CISA and the FBI followed with something more concrete. CISA is the Cybersecurity and Infrastructure Security Agency, the part of Homeland Security whose guidance critical-infrastructure operators are expected to follow, and its ask was specific: publish a memory-safety roadmap by January 1, 2026, prioritizing network-facing code and cryptography.

A memory-safety roadmap is a duller document than the name suggests. It names which parts of your codebase are memory-unsafe, marks the ones facing the network or handling crypto as the priority, and says how and by when you plan to get the defects out of them. It is paperwork that commits you to dates. And none of it carries the force of law, which is the detail people reach for when they want to skip it.

Read that date again. It’s behind us. We are past the point where memory safety was a forward-looking recommendation — we’re in the era where a C++ codebase without a migration story is a question your customers are allowed to ask about. When I said this migration is about the era more than the language, this is what I meant. Somewhere in the last two years memory unsafety turned into something many vendors have to explain in writing, and I’m not sure anyone decided that so much as it accumulated.

What the rewrite actually costs

Here is where I need to be careful not to write the advertisement.

Small rewrites take months. Medium ones run one to two years. The largest can run two to five, and a fair number of rewrites fail outright. Prisma moved its Rust query engine back to TypeScript, citing skill-set gaps and deployment complexity. Loglog Games walked away after three years, with a verdict that stuck with me: excellent for refactoring, poor for iteration speed. curl’s attempt to adopt hyper, the Rust HTTP library, got to 95% complete and then died on the last 5%.

Some of the performance wins aren’t even Rust’s. uutils sort runs about four times faster than GNU sort, and ripgrep chewed through a 37 GB directory in 6 seconds where grep needed 52. But a chunk of that is the advantage of rewriting anything with thirty years of hindsight and no backward-compatibility scar tissue. Some of the credit going to the language was earned by the fresh start, and I don’t think there’s a clean way to separate the two from the outside.

And when Microsoft ported the TypeScript compiler to native code, the team picked Go. Not Rust. They wanted structural compatibility with the existing codebase and velocity for a big team, and garbage collection was fine for their workload. In the middle of the biggest memory-safety push in industry history, one of the most-watched compiler projects on Earth looked at Rust and reasonably said no thanks.

Go back to those eleven days

I moved past something in the Bun story too quickly, and it deserves its own section.

That rewrite cost about $165,000. Set the number against the timelines from a minute ago. Half a million lines of systems code moving between two languages is a two-to-five-year project staffed by people who already know both languages well, and Bun did it in eleven days on a budget that would not cover one senior engineer for a year.

For most of my career, compiled languages lost on cost rather than on quality. You needed someone who already knew it, that person was hard to hire, and the work took long enough that the problem might stop mattering before you shipped. Prisma’s own explanation for reverting to TypeScript put skill-set gaps first, which is a staffing verdict wearing the clothes of a technical one.

Models happen to be very good at the specific thing that made Rust expensive. The design work stays human, and so does the call about whether a rewrite is worth attempting. What is left is the tedious middle: porting a known-correct implementation from one language to another, negotiating with a borrow checker that objects to line 400, writing the FFI boilerplate nobody enjoys. Rust’s learning curve was always front-loaded and mechanical, which is close to the worst possible profile for a person and close to the best one for a model.

From where I sit, that matters most for the work nobody was ever going to fund. Research software is full of Python that should be something faster, and it stays Python because a grad student has eighteen months and a thesis to finish, not because somebody weighed the engineering tradeoff and chose slow. Projects that got shelved as unjustifiable start looking plausible again when a compiled implementation stops costing a year of somebody’s life. Not all of them, and not the ones that were bad ideas to start with.

Then Kelley’s verdict lands on top of it, and none of that million lines has reached a stable release.

Both things are true at once and I don’t think the tension resolves cleanly. Writing Rust got cheap. The reviewing is where the cost went, and somebody still has to read a million lines of changed code. I have not seen a model anyone will hand that job to yet.

The escape hatch is part of the language

Rust lets you turn the guarantee off.

This gets left out of the pitch, and if you are the one deciding whether your team migrates, it is the part I would want to know first.

The keyword is unsafe, and it means what it says. Inside an unsafe block the compiler stops enforcing the rules that make Rust memory-safe. You can dereference a raw pointer. You can call straight into a C library. The borrow checker steps back and takes your word for it.

This is not an oversight anyone forgot to close. It has to exist, because sooner or later a program has to talk to hardware, or to an operating system written in C, or to a library nobody is ever going to rewrite. A language that couldn’t do those things couldn’t run a kernel, which is exactly why the kernel and Windows can take Rust at all.

The catch is that it makes the guarantee narrower than the slogan. The places where people reach for unsafe tend to be the driver, the allocator, the boundary where you hand a pointer to somebody else’s C. Which is to say the dangerous work is still concentrated in the code that opted out of the checking, and the compiler’s promise stops at the edge of those blocks.

What you get in exchange is a map, which is not nothing. Grep an unfamiliar Rust codebase for unsafe and you have your list of places to look by lunchtime. Thirty years of C hands you the whole repository and wishes you luck. Having the list is not the same as having read it, and I have no idea how many teams actually do. But Rust is memory-safe everywhere except the places somebody marked, and those places are searchable.

Then, six days ago, the other shoe dropped

On August 20, attackers published malicious versions of arrayref, internment, and append-only-vec on crates.io, Rust’s package registry, using compromised maintainer credentials. The poisoned versions pulled in a typosquatted crate called proc-macro1, a fake sibling of the real proc-macro2, and its build script downloaded a payload that ran at compile time. Together the compromised packages account for roughly 245 million lifetime downloads. The Rust security team pulled every malicious version 86 to 107 minutes after it went up, working from a report by Nextron Systems, which is faster than any registry response I can remember. Researchers at Wiz then linked the infrastructure to North Korean state actors, with overlap to a group tracked as UNC1069.

I have spent the past year writing about this exact playbook. npm got hacked. React got hacked. LiteLLM, GitHub. Every one of those pieces ended at the same place: the weak point is the trust we extend to dependencies by default. And now the ecosystem of the memory-safe language ran the identical script.

This was not a memory-safety bug. It was a trust bug.

Nothing the borrow checker verifies has anything to say about a stolen credential or a build script that executes whatever it likes on your machine at compile time. The first CVE in the Linux kernel’s Rust code makes the same point from another angle: it was a race condition, a class of bug memory safety was never going to catch, and plain logic errors get the same pass. In the code nobody marked unsafe, Rust closes off a whole category of vulnerability, and it is a big and expensive category. Registries, maintainer accounts, build scripts, stolen credentials: none of that gets safer because the implementation language changed.

The models are working both sides

Go back to those eleven days once more, because there is a version of that story where I am the mark.

The capability that made a half-million-line migration affordable also opened a supply-chain failure that did not exist a few years ago, and it is further along than I expected when I started reading for this piece.

Ask a coding model for a library and it will sometimes name one that does not exist. The name is usually an invention rather than a typo, plausible-sounding and produced whole. One academic study across 576,000 samples put the rate of hallucinated package names at 19.7%. The Cloud Security Alliance found that 43% of those invented names come back on every re-run of the same prompt. Stable is the word doing the damage in that sentence. A one-off hallucination is noise, but a repeatable one is a name somebody can camp on and wait. In May, researchers found 127 hallucinated package names that Claude Sonnet 4.6, GPT-5.4-mini, Gemini 2.5 Pro, and DeepSeek V3.2 all produced. The same fake names, across four different labs’ models.

Somebody named this slopsquatting, which I hate and cannot improve on.

The exposure widens when an agent is the one installing. A person reading proc-macro1 sitting next to proc-macro2 at least has a chance of squinting at it. An agent checks whether the name resolves, and if it resolves, it installs. North Korean operators have already built for this on purpose: the PromptMink campaign wrote npm README files engineered to read as authoritative to a language model rather than to a human being.

The ceiling is higher than nuisance, too. Anthropic reported disrupting what it described as the first AI-orchestrated cyber espionage campaign, a Chinese state-sponsored group that manipulated Claude Code into carrying out the intrusions itself against roughly thirty targets.

So the ledger has entries on both sides. The models that cut the cost of writing Rust from years down to eleven days also cut the cost of running an intrusion campaign, and they introduced a dependency-trust problem that nobody had in 2023. Both of those land well outside anything the borrow checker watches. They come back to the same old question, which is whether the thing you just installed is the thing you meant to install.

What to actually do with this on Monday

Most of this lands on whoever maintains C or C++ somewhere that matters, so start there, and start with the roadmap rather than with any code. I’d start by listing the components written in memory-unsafe languages, then marking the ones that parse untrusted input or face the network, and putting real dates on the worst two. That covers most of what CISA actually asked for, and I would rather draft it on a slow Thursday than while an auditor is waiting on it.

If you write Rust, the job is narrower. The Rust security team published a command for checking whether any of the compromised versions ever reached your machine, scanning your local ~/.cargo/registry/cache for the affected releases. I’d run it even if you are fairly sure. Then go read what your build scripts do, because build.rs executes arbitrary code at compile time with your permissions, and I would bet most of us have never opened one belonging to a dependency we installed.

If an agent adds dependencies for you, add one step before the install: confirm the package existed before your model suggested it. Downloads, repository, history. That is the whole check, and it catches the stable hallucinations before they reach your lockfile.

Everyone else gets the short version: open your dependency tree and count maintainers instead of packages. I keep returning to that number because it is the one thing in this story that a language migration does not touch.

Bigger foundations, bigger targets

So why is everything written in Rust now? Because for once, safety, performance, and liability are all pushing in roughly the same direction, and the tooling got good enough that switching stopped requiring belief. My terminal is faster and my OS is safer, and I paid nothing for either, and I’m not sure what I’d even complain about there.

But the part I keep turning over is what we actually traded. We swapped a bug class we understood for an attack surface that keeps growing in directions nobody budgeted for. A model invents a dependency name and somebody has already registered it. A million lines of rewrite land in eleven days and nobody has read them. Safer bricks, bigger building, and the same cheap lock on the front door we’ve been meaning to replace since the npm incident.

I don’t have a tidy place to leave that. The migration is worth it; Android’s numbers alone settle the question for me. It’s just not the whole answer, and the people selling it as one are the same people who will be surprised by the next arrayref.

Which tool in your stack changed languages underneath you without asking? And if you maintain C or C++ somewhere critical: does your memory-safety roadmap actually exist, or does it just exist in the sense that someone will write it after the next audit? I’d like to hear which one it is.

I’ll keep writing about this shift as it plays out, the supply-chain incidents included, because the two stories are converging fast. Subscribing is the easiest way to follow along.

Cordero is a research software engineer at the University of Washington’s Scientific Software Engineering Center. If this was useful, send it to the teammate who still maintains the C++ service everyone is afraid to touch. They’ve earned the context.