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.
- 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.
Related agent uses
Check upgrade risks before you ship
A ReAct agent reviewed dependency data for a planned cloud upgrade and blocked it when it found an incompatible SDK version.
Break one goal into a sequenced coding plan
Ordewell turns a single objective into a step-by-step task list for coding agents, with dependencies, review, and parallel runs.
Check a codebase for redundant packages and polyfills
An agent can scan code and install commands to find dependencies that can be replaced with built-ins or better options.
Assemble a R coding agent from three basic tools
They wired a Claude agent in R to file and shell helpers, then hardened it with safer path checks and editing functions.
Trace C# symbol usage with a Roslyn-backed index
Graphify C# helps agents map real C# usages, including overrides and implementations, from compiler-resolved project data.
Set up a GitHub bot that triages and patches bugs
They built a GitHub bot that sorts issues, reviews pull requests, answers with citations, and opens patch PRs for humans to check.