Skip to main content
Yoosuf Mohamed

AI & Tech

The Language Humans Find Hard Just Got Cheaper

AI agents didn't settle the Rust vs Python argument. They changed the economics of who can afford to rewrite the slow parts.

5 min read

By Yoosuf Mohamed, Systems Architect

Back in April 2023, someone on X posted: “AGI will be built with Python. Let that sink in.”

Elon Musk replied with one word: “Rust”.

We don’t have AGI, so nobody won that argument. But something else happened in the years after that tweet. A lot of serious engineering teams started rewriting important systems in compiled languages, and AI agents made those rewrites a lot less expensive to attempt.

I don’t think the story is “Python lost” or “Rust won”. It’s messier than that, and the messy version is more useful.

The pattern I’m seeing

A few examples have piled up recently:

  • OpenAI moved its Codex CLI from TypeScript to Rust in 2025, citing performance, security, and simpler installs.
  • Bun , now owned by Anthropic, was rewritten from Zig to Rust in 2026, largely with Claude.
  • GitHub rebuilt the Copilot agent runtime from TypeScript into 800,000+ lines of Rust in September 2026, using Copilot.
  • Anthropic moved its Messages API from Python to Rust, announced in November 2026. It reported about 70% less CPU per request.

The interesting part is that this isn’t a clean Python-to-Rust morality tale. Some of these rewrites started in TypeScript or Zig. Microsoft ported the TypeScript compiler to Go, not Rust, and reported roughly 10x speed gains. The real shift is simpler: when performance matters, teams are moving closer to native, compiled code.

This started before AI agents

It’s tempting to frame this as an AI-era phenomenon, but the older examples matter because they were disciplined.

Discord moved its Read States service from Go to Rust back in 2020. The Go version had latency and CPU spikes roughly every two minutes, tied to garbage collection. Cloudflare replaced its NGINX-based proxy with Pingora, written in Rust, in 2022. It reported about 70% less CPU and 67% less memory for the same traffic, with savings coming from both the new architecture and the language.

Those weren’t vibes-based rewrites. They had a clear problem, a measurable boundary, and numbers before and after. I like those examples because they keep us honest.

Why agents changed the math

For a long time, engineering teams made a sensible trade. People were expensive, compute was comparatively cheap, and rewrites were terrifying. Picking a language that was quick to write and easy to hire for was often the right call.

Rewrites also froze roadmaps. You could spend years paying for a migration while your product stood still.

AI agents weaken both constraints. GitHub said a rewrite of that size wasn’t affordable before agents. A steep learning curve matters less when an agent can produce a first draft, translate patterns, and grind through the boring parts. The compute bill, on the other hand, doesn’t care how productive your team felt this sprint. It shows up every month.

So the question changes from “can we afford to write this?” to “can we afford to keep running this?”

The catch: passing tests is not the same as being correct

This is the part I don’t want people to skip.

By April 2026, Anthropic’s Rust API reportedly passed about 98% of integration tests. On real production inputs, only about a quarter initially matched the Python results. The team ran both versions against live traffic and treated the old one as the source of truth. GitHub also reported regressions it had to trace and fix after porting.

The details are where the real lesson lives:

  • Half a rewrite barely helped. Porting only the output parser cut CPU by 8% to 10%, while tokens crossed between Python and Rust three times.
  • Tests got weaker in translation. Anthropic found more than 100 weakened assertions among about 700 ported integration tests.
  • A green check wasn’t enough. An agent proposed copying missing text into local files. The outputs matched, but an engineer rejected the shortcut because it was the wrong fix.

Bun saw a smaller version of the same problem. Its mostly mechanical port introduced 19 subtle regressions because code that looked alike in Zig and Rust behaved differently.

That’s the thing about agent-assisted rewrites. They can move fast through the code, and they can also move fast past the meaning of the code.

The part that stays human

If you’re an engineer watching this trend, I wouldn’t take “learn Rust” as the main lesson. The more durable lesson is that competing with AI on typing speed is a losing game.

The work that gets more valuable looks like this:

  • Drawing boundaries so a system can be replaced one piece at a time.
  • Defining correctness before code is generated.
  • Building verification that an agent can’t quietly weaken.
  • Owning the failure when the system breaks at 2 a.m.

An agent can write the change. A team still decides to ship it.

Before you rewrite anything

If someone on your team is excited about an AI-assisted rewrite, I’d ask four boring questions first.

  1. Where is the cost? If your service mostly waits on a database or network call, a faster language may not move the needle much.
  2. Can you draw a clean boundary? A well-separated module can be replaced and rolled back. A tangled one turns a rewrite into a hostage situation.
  3. What is your source of truth? Tests help. Comparing against real production behaviour helps more.
  4. Who will run it at 2 a.m.? Someone on the team has to be able to read, debug, and fix the new code when it’s their problem.

If you can’t answer all four, the agent’s speed only gets you to the problem sooner.

I like Rust. I like fast systems. But I don’t think “big companies are rewriting things” is a strategy. Profile first. Find the hot path. Prove the boundary. Then rewrite the part where the numbers justify the pain.

This post was originally published as an edition of my LinkedIn newsletter, Shoutout from Yoosuf .

  • AI
  • Rust
  • Software Architecture
  • LLM
  • Engineering
  • The Next 18 Months Will Redefine Cybersecurity

    Why AI agents, machine-speed attacks, identity sprawl, software supply chains, and recovery failures are pushing cybersecurity from a perimeter problem into an architecture problem.

  • How to Enjoy Programming in the LLM Era

    Why coding feels less fun since AI assistants arrived, what METR's productivity trial and Stack Overflow's trust data actually show, and the personal habits and team practices that keep comprehension of your own system yours.

  • The Model Won't Ask You Back

    Why a thin question becomes a confident wrong answer, which parts of the prompting folklore are already stale, and why it is a writing skill.

Start a project

Have an idea worth building?

Whether you need an AI product, a platform audit, or a reliable engineering partner, tell me what you're working on. I'll respond with the best next step.

Prefer email? [email protected]