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
Use an agent to repair two bugs and add tests
A developer had coding agents diagnose two precise bugs in an open-source tool, then generate fixes and tests for both.
Coordinate fix-and-review loops with a lead agent
A lead agent managed implementation and review between two subagents, only involving the human when a choice fell outside its authority or reviews kept failing.
Run bug fixes through a staged agent team
Use separate agent roles to reproduce, diagnose, review, and audit bugs before any irreversible step.
Build a DOS coding agent for an old PC
Claude made a tiny DOS tool that could talk to Claude and write code on an IBM PC XT.
Run coding agents in parallel with tmux and Markdown specs
Manuel Schipper uses separate tmux panes and numbered Markdown specs to keep several coding agents moving at once.
Use agents to propagate one ML improvement across ranking models
Meta used custom agents to help adapt and roll out a training technique across ads ranking models, with engineers approving plans and final shipping.