Email me

Dev · · 13 min read · Matt Busel

Filed under Opinion Rust Coding agents

Rust is the language AI will be written in. 13,243 crates agree

Rust is the language AI will be written in. 13,243 crates agree
On this page · 14 sections
  1. Key numbers
  2. Python won the demo. Rust is winning everything after the demo
  3. 13,243 new AI crates this year, and nobody voted for it
  4. Your Python is already Rust underneath
  5. The AI stack, by the bytes
  6. Anthropic's own runtime just fled Zig for Rust
  7. The compiler is the guardrail AI code was missing
  8. @karpathy says English is the hottest language. English needs a compiler
  9. Taking apart the other contenders
  10. Follow the money: fast code is cheap inference
  11. The strongest case against us
  12. Where this goes: our bets
  13. What this means for you
  14. Sources

Short answer: Yes, Rust is the future of AI software, and the switch is already happening under your feet. Python is still the language people type into notebooks, but the code that actually runs, the tokenizers, the package managers, the vector databases, the coding agents and now even Anthropic's own JavaScript runtime, keeps getting rewritten in Rust. We pulled crates.io, PyPI and GitHub tonight: 13,243 new Rust crates built for AI so far in 2026, 32x the 2024 count, and 54% of the fast native Python packages released since 2020 are Rust inside. Every other language in this fight has a reason to exist. Only one has a compiler that can say no to an AI.

TL;DR: New crates.io crates tagged for AI (llm, ai, agent, mcp and six more) went from 413 in 2024 to 2,013 in 2025 to 13,243 between Jan 1 and Oct 24 2026. Of the top 500 Python packages by downloads, 23 are compiled Rust, pulling 4.95 billion downloads a month, and Rust wrote 14 of the 26 native packages first released since 2020 (C wrote 6). In May, Bun, the runtime Anthropic bought to power Claude Code, merged a port of 535,496 lines of Zig into Rust, done by up to 64 Claude agents in parallel for about $165,000, and its memory in a 2,000-build test dropped from over 6.7 GB to 609 MB. The lesson for you: let the AI write the code, and let a strict compiler check it. That compiler is Rust's.

Key numbers

WhatNumberSource, checked Oct 24 2026
New AI-tagged Rust crates, per year413 (2024), 2,013 (2025), 13,243 (2026 to Oct 24)Our pull, crates.io API
Top 500 PyPI packages that are compiled Rust23, with 4.95B downloads in 30 daysOur pull, top-pypi-packages + PyPI + GitHub APIs
Native Python packages first released 2020 or later, written in Rust14 of 26 (54%)Our pull, same
Rust share of OpenAI's Codex repo97% of code bytesOur pull, GitHub languages API
Bun's Zig-to-Rust port535,496 lines, 64 Claudes at peak, about $165,000InfoQ, Sep 20 2026
Bun memory, 2,000 consecutive buildsover 6.7 GB (Zig) vs 609 MB (Rust)InfoQ, Sep 20 2026
Memory-safety bug density, Androidabout 0.2 per million lines of Rust vs about 1,000 in old C and C++Google, Nov 13 2025
Energy per benchmark, normalized to CRust 1.03, Go 3.23, Python 75.88Pereira et al., 2021
Checks between an agent's code and your users518 rustc error codes, 847 Clippy lintsOur data, /rust/errors/ (rustc 1.99.0) and /rust/clippy/
Animated bar chart of new crates.io crates tagged for AI per year: 68 in 2020, 54 in 2021, 106 in 2022, 293 in 2023, 413 in 2024, 2,013 in 2025 and 13,243 in 2026 through Oct 24.
New AI-tagged Rust crates per year (llm, ai, agent, mcp and 6 more keywords). crates.io API, Tensorust pull, Oct 24 2026.

Python won the demo. Rust is winning everything after the demo

Here's the take, no hedge: Rust is the only programming language that deserves to run AI, and the future of AI depends on it becoming the most used language on earth.

Not because Rust is pretty. Because AI changed who writes code. When a model writes most of your lines, the bottleneck stops being typing speed and becomes trust. You need a language where wrong code doesn't compile. That is Rust's whole personality.

Python is the steering wheel. It stays. But look under the hood of anything that ships, and the engine is getting swapped, one rewrite at a time. Developers already know it: Rust has topped Stack Overflow's most admired list every year it has been on it, 72% in 2025. We went and counted what they actually ship.

13,243 new AI crates this year, and nobody voted for it

We pulled every crate on crates.io tagged llm, ai, agent, mcp, machine-learning, openai, inference, deep-learning, llama or transformer, 16,293 crates in all, and bucketed them by the day they were created.

2023: 293. 2024: 413. 2025: 2,013. 2026, through tonight: 13,243. The peak quarter was 2026 Q2 with 4,747, which is more than every year before 2025 combined, times ten.

Line chart of new AI-tagged Rust crates per quarter from 2023 Q1, flat near 50 to 116 through 2024, then 203, 366, 540 and 904 in 2025, then 3,326, 4,747 and 3,841 in 2026 Q1 to Q3 and 1,329 in the first 24 days of Q4.
New AI-tagged crates per quarter; 2026 Q4 covers Oct 1 to 24. crates.io API, Tensorust pull, Oct 24 2026.

Real talk on the quality: plenty of these are tiny. The median 2026 crate has 136 downloads. But 1,011 of this year's crates already pulled 1,000+ downloads in the last 90 days, and the big ones are on fire. The official MCP Rust SDK, rmcp, has 39.9 million downloads, and 56% of them landed in the last 90 days. Hugging Face's tokenizers crate: 41.8 million all time, 42% in the last 90 days. Candle, Hugging Face's Rust ML framework: 39% in 90 days.

Our read on why the line goes vertical right when coding agents went mainstream: agents are picking Rust. A human picks the language they already know. An agent picks the language where its mistakes get caught before you see them. Nobody has proven that motive yet, but the timing is lowkey impossible to ignore.

Your Python is already Rust underneath

"Python is the language of AI" is the most repeated line in tech, and it's half a lie. We took the 500 most downloaded Python packages (30-day counts, list updated Oct 1 2026), asked PyPI which ones ship compiled wheels, then asked GitHub which compiled language each one is written in, by bytes.

108 of the 500 ship native code. We could trace 97 to a repo. C wrote 40, Rust 23, Cython 18, C++ 16. Rust is already number two, and that's counting packages from 2005.

Now split them by when they first hit PyPI. Before 2016: Rust wrote 4 of 45. Since 2020: Rust wrote 14 of 26. That's 54% of all new fast Python, more than C, C++ and Cython combined.

Horizontal bar chart of the 26 top-500 PyPI packages with native wheels first released in 2020 or later, by main compiled language: Rust 14, C 6, Cython 3, C++ 3.
What new fast Python is written in. PyPI JSON and GitHub languages APIs over the top 500 PyPI packages (list of Oct 1 2026), Tensorust pull, Oct 24 2026.

The list reads like the AI stack's spine: pydantic-core (809 million downloads a month, every OpenAI and Anthropic SDK validates through it), jiter (the JSON parser behind those SDKs), tiktoken (OpenAI's tokenizer), tokenizers and safetensors (Hugging Face), hf-xet (Hugging Face's new storage client, 189 million a month, born January 2025), uv and ruff (Astral), polars. And cryptography, the 9th most downloaded package on PyPI at 1.07 billion a month, rewrote its core in Rust years ago and never looked back.

So when someone tells you Python runs AI, ask them what runs Python's fast parts. Increasingly, the answer is Rust.

The AI stack, by the bytes

Next we pulled the language breakdown of the repos the AI economy actually runs on. Bytes don't lie and don't do PR.

Horizontal bar chart of Rust share of code bytes in AI repos: uv 98%, codex 97%, tokenizers 95%, qdrant 90%, bun 76%, candle 75%, goose 72%, polars 62%, vllm 6%, and 0% for claude-code, ollama and llama.cpp.
Rust share of each repo's code by bytes. GitHub languages API, Tensorust pull, Oct 24 2026.

OpenAI's Codex CLI: 97% Rust. OpenAI rewrote it from TypeScript in June 2025 and said why out loud: no Node.js dependency, real sandboxing on Linux, no garbage collector eating memory. uv: 98%. Hugging Face tokenizers: 95%. Qdrant: 90%. Candle: 75%. Block's goose agent: 72%. Polars: 62%.

The holdouts are the model servers and the chat CLIs. llama.cpp is C++, Ollama is Go, vLLM is 6% Rust, PyTorch is C++ and Python. Claude Code, Gemini CLI and opencode are TypeScript on top.

But "on top" is doing a lot of work for Claude Code. Since v2.1.181 on June 17, it runs on Bun. And Bun is now 76% Rust, with zero bytes of Zig left. Which brings us to the most important rewrite of the year.

Anthropic's own runtime just fled Zig for Rust

Anthropic bought Bun on Dec 3 2025 to be "core infrastructure" for Claude Code and the Agent SDK. Bun was the poster child for Zig, the language its fans pitched as the modern, simpler alternative to Rust.

Then Bun's creator, @jarredsumner, looked at his bug list and saw a large share was use-after-free, double-free and "forgot to free" on error paths. Memory bugs. The exact class Rust's compiler refuses to build.

So he pointed Claude at all 535,496 lines. Up to 64 Claude instances ran in parallel, each implementer with two adversarial reviewer agents, for about $165,000 at API prices: 5.9 billion uncached input tokens and 690 million output tokens. The port itself ran 11 days; the whole thing went from start to a stable v1.4.0 in about four months, against Sumner's estimate of three engineers for a year by hand.

Bar chart of Bun memory after 2,000 consecutive Bun.build() runs: over 6.7 GB on the Zig build v1.3.14 versus 609 MB on the Rust port v1.4.
Bun memory before and after the Zig-to-Rust port, as reported by InfoQ on Sep 20 2026 from Bun's own numbers.

The results, per InfoQ: v1.4.0 fixed 128 longstanding bugs, memory in a 2,000-build test plateaued at 609 MB instead of climbing past 6.7 GB, HTTP got 2% to 5% faster. It also shipped 19 subtle regressions, which is what an honest rewrite looks like.

And Sumner said the quiet part in one line: "Compiler errors are a better feedback loop than a style guide." That's the entire thesis of this article, from the guy whose runtime powers Anthropic's flagship product. Zig fans, respectfully, your biggest app is cooked.

The compiler is the guardrail AI code was missing

Here's what nobody selling "vibe coding" wants to say: models write bugs at machine speed. The question isn't whether your agent makes mistakes. It's what catches them.

In Python, the answer is your users, at runtime. In C and C++, the answer is an attacker, years later. In Rust, it's the compiler, before anything runs. Our Rust error index covers all 518 error codes rustc 1.99.0 can throw, and our Clippy index covers 847 lints on top. That's 1,365 named ways your agent's code can get rejected before a human ever reviews it.

Stat card: 1,000x fewer memory-safety bugs per line of Rust than Android's historical C and C++, about 0.2 versus about 1,000 per million lines.
Google, Rust in Android: move fast and fix things, Nov 13 2025.

The receipts on why that matters are not ours, they're the incumbents'. Microsoft said about 70% of the vulnerabilities it assigns a CVE each year are memory-safety bugs. Google says Android's memory-safety bugs fell below 20% of all its vulnerabilities in 2025 for the first time, with about 5 million lines of Rust in the platform, roughly 0.2 memory-safety bugs per million lines of Rust against about 1,000 in its historical C and C++. More than 1,000x. Rust changes there also roll back about 4x less often and spend about 25% less time in code review.

Read that last bit again. Less review time. In a world where review is the bottleneck for AI-written code, Rust is the language that makes review cheaper. And Linux, the most conservative codebase alive, officially ended its "Rust experiment" in December 2025. Rust in the kernel is here to stay.

@karpathy says English is the hottest language. English needs a compiler

In January 2023, @karpathy posted that "the hottest new programming language is English." A year later Jensen Huang told the World Government Summit that the job is to build computing "such that nobody has to program."

They're right about the input and wrong about the output. English is how you ask. It is not what ships. Every prompt still becomes code, and someone or something has to decide whether that code is correct. English has no type checker. Prompts don't fail to compile. They fail in production.

Our bet: the more code AI writes, the more valuable the strictest compiler becomes, not the less. "Nobody needs to program" turns into "nobody needs to program, so everybody needs a machine that rejects bad programs." That machine is rustc. And yes, Nvidia selling more GPUs if the world runs slow code is a fun coincidence to sit with.

Taking apart the other contenders

Python: the best prototype language ever made

Python's win is real: notebooks, libraries, every model tutorial. But in the Pereira et al. benchmarks, Python burned 75.88x the energy of C and took 71.9x the time; Rust came in at 1.03x. The 2024 critique of that paper concluded energy mostly tracks run time, which is our point exactly: slow code is an electricity bill. Python stays as glue. The glue is already calling Rust.

C++: its own creator is sounding the alarm

In February 2025, Bjarne Stroustrup sent the C++ committee a note calling for action against what he described as unprecedented, serious attacks on C++, pushing his "profiles" plan for safety. When the language's creator writes a defense memo, the language is on defense. llama.cpp is a masterpiece, and it's also a memory-safety lottery ticket every time a model writes a patch for it.

Go: fine, until you care about the last 10%

Microsoft ported the TypeScript compiler to Go in 2025 for 8x to 12x faster builds, and Anders Hejlsberg said Rust would have forced a redesign of the compiler's data structures. Fair for a faithful port of a 10-year-old codebase. But Go keeps a garbage collector, and Codex left TypeScript precisely to get away from one. Ollama is Go and it's great at what it does: wrapping llama.cpp, which is C++.

Zig: see Bun

Zig's flagship app, owned by an AI lab, just moved to Rust with AI doing the move. We don't need to add anything.

Follow the money: fast code is cheap inference

Every request an agent handles runs through tokenizers, JSON parsers, schema validation, retrieval and a sandbox before and after the model call. The model is the expensive part, but the glue runs on every request, forever.

Here's our estimate, labelled as ours: if a Python service burns even 10x the CPU of a Rust one on that glue (the benchmarks above say up to 70x), a company paying $1 million a year in CPU for its non-GPU layer is paying $900,000 of it for the language choice. That's why the companies with the biggest bills, OpenAI, Hugging Face, Astral, Qdrant, are the ones rewriting first.

Who loses? Consultants selling "Python at scale" performance work, cloud providers billing for idle CPU, and anyone whose moat was "our team only knows Python." Who wins? Small studios like us. A fast, safe binary on one box beats a fleet of slow containers. Owning a stack that cheap is how you stay independent.

The strongest case against us

The model hot path isn't Rust yet. PyTorch is 0% Rust by bytes, llama.cpp is 0%, vLLM is 6%. CUDA kernels are C++. Rust compiles slowly and the borrow checker humbles everyone at first. And 2026's crate boom includes a lot of agent-made filler.

All true. Now look at the direction. Every one of those objections was also true for tokenizers, package managers, linters and JS runtimes, and every one of those flipped. Candle and Burn already exist, mistral.rs already serves models, and agents don't mind the borrow checker because they don't get tired. The learning curve was Rust's real tax. AI just paid it for you.

Where this goes: our bets

Bet one: by October 2027, at least one top-5 inference server or ML framework ships a Rust core for its serving path. Bet two: Claude Code itself gets a Rust core, because Anthropic now owns a Rust runtime and watched 64 of its own models port half a million lines in under two weeks. Bet three: when we rerun this pull on Apr 24 2027, Rust will write more than 60% of new native packages in the PyPI top 500.

Nobody can prove any of that tonight. The pattern says it anyway. Check our receipts in the CSVs below and come back in six months to roast us if we're wrong.

What this means for you

Learn Rust now, while knowing it is still an edge. Better: let your agent write it and let the compiler do the review. Start with the parts that hurt, the hot loop, the parser, the CLI, and keep Python as the steering wheel. Our Rust hub, crate pages and Cargo Check Action (free on public repos) cover the stack, and we wrote up what happens when an AI builds a database in Rust. More arguments live on Opinion and the Rust topic page.

Stuck on a compiler error your agent keeps looping on? Send it to us: Fix my Rust error, $49. We send back the fix and why it works, and we keep fixing it at no extra cost until it compiles and does what it promises.

Sources

First published here on tensorust.com on Oct 24, 2026. Related: Rust error index, Clippy lint index, Cargo Check Action, Opinion.

Up next

More on RustI ran 20 AI coding agents on one PC. The bottleneck was the compiler.Running 20 coding agents in parallel on one PC: the model never slowed things down, the compiler did. How content-hashed test caching fixed it.Read it next →

Cite this

Free to cite and reuse under CC BY 4.0 with a link back. How it was collected: methods. Spotted an error? Corrections.

Did this answer your question?

Get the next one by email.

What my AI agents tried this week, with the real numbers: what worked, what flopped, what made money. One email when there is something worth reading.

No spam, never sold. Every email has a one-click unsubscribe.

What are people saying about this? Read and post on The Floor →

More: the author, related reading, share this, a free game

Try it yourself · Rust dev?

Check a crate before you depend on it

Release health, reverse deps, real downloads and the alternatives for 1000 crates.

In The Manual: on this topic

Explainers answer one question, short answer first. Guides walk you through it step by step.

Open The Manual →

Read next

All articles →

1M+ X impressions in 4 days, run by AI agents · 8 iPhone apps live on the App Store · 69 Rust crates on crates.io · 520 GitHub stars · O'BLOCK out now, free on Steam

Built by Matthew Busel · code on github.com/Mattbusel · numbers as of Oct 22, 2026, click any to check

Popular in the shop

All 124 tools →

Browse: Bundles and kitsHome, family and schoolMoney and businessAI toolsSports and fitnessMaking and hobbiesFood and drinkIndie dev and launchTrading and quant

Free: Landing page teardown iPhone app cost calculator LLM API cost calculator Paid online: $49 Launch Check App builds Articles FAQ