Microsoft Co-Pilot Runtime Remade With Rust with $120,000 in tokens
(or: Copilot rewrote Copilot, the compiler did not clap, and TypeScript left the building carrying V8)
Microsoft Co-Pilot Runtime Remade With Rust with $120,000 in tokens
(or: Copilot rewrote Copilot, the compiler did not clap, and TypeScript left the building carrying V8)
The engine under GitHub Copilot — CLI, app, SDK, cloud agent, the ghost in VS Code, Visual Studio, Excel, Outlook, PowerPoint, and a pile of Microsoft cloud services you forgot had a personality — is now production Rust. Not a sidecar. Not a “we wrapped Node and called it native.” Entirely Rust. Agents wrote most of it. The token bill was about $120,000. A distinguished engineer spent roughly three weeks herding the circus. May to August. 14.5 weeks. 135 releases. About 1.3 port PRs a day. Continuously shipped, no big-bang funeral for TypeScript.
The raw conversion: ~430,000 lines of TypeScript became ~832,000 lines of production Rust, plus ~469,000 lines of Rust unit tests, because Rust does not believe in vibes. They did not redesign the runtime. They replaced modules one at a time, left the architecture alone, and put “make it actually elegant” on the next sprint like grown-ups. Sixty npm dependencies walked out because the code that needed them had already left.
Why bother? TypeScript plus Node plus V8 is a wonderful way to invent a product. It is a miserable way to embed that product inside six languages at once. Every SDK consumer — C#, Python, Go, Java, Rust, TypeScript — used to spawn a Node subprocess and yell JSON-RPC across a process boundary. A Node sneeze killed the session. Startup was a small novel. Density was a joke you told finance. Stephen Toub’s requirements were rude and specific: C ABI, low startup, predictable RAM, in-process embedding. Rust was the language that said yes without hiring a GC to live inside Excel.
The punchline is the benchmark, not the press release. One thousand one-turn session lifecycles, shared client, 100 concurrent pipelines: TypeScript did 7.55 per second. Rust in-process did 120. That is 15.9× on that workload. Memory for a 10-client agent swarm: 1,383 MB in TypeScript, 126 MB in Rust. Client + session + one turn + teardown: 5.25 seconds out-of-process on the old stack, 292 milliseconds in-process on the new one. The runtime stopped commuting to another process to finish a thought.
Copilot used Copilot to rewrite Copilot. GPT-5.6 Sol and Claude Opus 4.8 got name-checked for different parts of the job, because even monopolies have a model tasting menu. Token accounting from Toub: ~136.3 billion tokens total, almost all of it cached input. The popular picture of AI vomiting code is backwards. The agents spent about 10× more time reading, searching, and poking diagnostics than editing. They investigated. They hypothesized. They made a small change. They did it again. That is not vibe coding. That is an intern who finally learned to open the file.
Then it got sitcom-grade. session.ts was a 30,000-line TypeScript haunted house that touched everything. The porting session ran 25 hours. First 56 minutes: read the docs, 122 tool calls, no heroics. Then it spawned 15 child sessions, each with its own worktree. Then the children started DMing each other. One session hunted down every other live session whose mission overlapped and asked to coordinate. Two sessions independently found they were stepping on the same floorboards; one declined to hand off; the other merged anyway, because neither had a manager. If you wanted a metaphor for 2026, that is it: unsupervised roommates refactoring a nuclear plant, politely.
RustConf, same week NVIDIA bought a Platinum chair, heard the other half of the joke. Lisa Crossman: the compiler is not an oracle. Rust stops the agent writing memory-unsafe code. It does not stop the agent writing the wrong program correctly. Toub’s version: “if it compiles, it’s correct” is useful only as a joke. They collected dozens of regressions — ambiguous semantics, branch drift, features that never made the boat, replacement crates that almost meant the same thing. Most fixed. Some never reached stable. Borrow-checker errors were only about 1.7% of the rustc diagnostics. The models mostly failed ordinary type-and-name class. The scary language was not the hard part. Meaning was.
This is not “every TypeScript program should become Rust.” Toub said that. Believe him. This is: when you need a C ABI, density, and a runtime that can live inside Office without dragging V8 in like a timeshare, the rewrite that used to take a team a year or two — and would never have been approved — now costs a Distinguished Engineer’s side project and a token invoice the size of a nice car.
Bun’s Zig-to-Rust agent port burned $165k and got called “unreviewed slop” by Zig’s own creator. Microsoft shipped incrementally, kept tests, admitted the regressions, and still got 16× on the lifecycle bench. Same species of experiment. Different adult supervision.
The industry move is the stack of headlines in one month: Ubuntu finishes Rust coreutils, NVIDIA compiles kernels from Rust to PTX, Microsoft puts the Copilot runtime in Rust using Copilot. The biggest companies are not rewriting core infrastructure in Rust because a conference lanyard told them to. They are doing it because embedding, startup, and memory became product constraints, agents made the labor theoretically affordable, and the compiler is a mean enough teacher that the slop at least type-checks.
Do not miss it means: the bottleneck is no longer “can we afford the port.” The bottleneck is “do we have tests that notice when the agent wrote the wrong program correctly.” Microsoft had those. A lot of teams have a README and a dream.
Meanwhile at the disco
Disco Party and Remade With Rust exist for the same ugly reason Toub listed: embeddable, local, predictable, no extra process, no extra runtime, no extra religion. Agents can grind a port. They cannot invent your threat model. We still write the parts that touch identity, media, and the disk like the compiler is a teacher — and like the agent will cheerfully implement the wrong session.ts with beautiful types. $120k bought Microsoft a native Copilot. It did not buy anyone a substitute for taste.
x.com/farmer_timmm
메타데이터
- post_id
- 6ff0322f709b
- slug
- microsoft-co-pilot-runtime-remade-with-rust-with-120-000-in-tokens-6ff0322f709b
- url
- https://medium.com/@talmondrlm/microsoft-co-pilot-runtime-remade-with-rust-with-120-000-in-tokens-6ff0322f709b
- canonical_url
- https://medium.com/@talmondrlm/microsoft-co-pilot-runtime-remade-with-rust-with-120-000-in-tokens-6ff0322f709b
- author_url
- https://medium.com/@talmondrlm
- status
- ok
- fetched_at
- 2026-09-22 13:46:55