Translate a runtime to Rust module by module

Microsoft used agents to replace the Copilot runtime’s TypeScript with Rust while keeping the implementation’s overall design the same.

Done with Custom agent· Advanced

What they did
Microsoft relied on Copilot, powered by several LLMs selected for different strengths, to carry out the port. Instead of redesigning the runtime, the system swapped in Rust piece by piece. For the 30,000-line session.ts file, one session read the documentation, then launched 15 child sessions in separate worktrees so they could split up the work.
How it went
The migration ran for 14.5 weeks and went through 135+ releases. It produced 430,000 lines of TypeScript replacement code in Rust, and one benchmark improved by 15.9x while memory use fell from 1,383 MB to 126 MB. A few dozen regressions still appeared, and the effort cost roughly $120K in tokens plus about three weeks of a developer’s time.
Tips
Treat passing builds as only one checkpoint; bugs can still survive compilation. For a project like this, keep human review in the loop before any release, merge, or submission.

Try it yourself with Codex

I need to convert [module or system] from [source language] to [target language] without changing its user-facing behavior or redesigning the architecture. Break the job into small parts, inspect the current code and docs first, and use parallel helper sessions where that would speed things up. For each part, produce the replacement code, point out any uncertain spots, and stop before any merge, release, submit, deploy, delete, or send step until I approve. Then give me the next tests or benchmarks to run and list any risks of regressions.

Fill in the [brackets]. Agents can make mistakes, so review anything before it is sent, paid or deleted.

Get 3 agent uses like this every morning

With the day's top AI news. Free, and one click to unsubscribe.