When should you use it?
- A runtime's language limits performance or embedding
- The codebase keeps changing during the port
- You need to avoid a big-bang cutover
Not for: Small apps where a rewrite is not justified; Teams without strong test coverage
What do you need, and what do you get?
You need
- A coding agent with repo access
- A temporary interop layer between old and new languages
- CI and incremental rollout
You get
- Ported modules merged continuously
- A temporary seam that shrinks to zero
- A native binary with a small public interface
How does it work, step by step?
- Pick an incremental strategyPort function by function on main instead of on a separate branch held open for months.
- Build a temporary seamExpose ported Rust to the remaining TypeScript and back through Node native bindings.
- Keep shippingMerge each piece so users meet regressions one at a time, when they are easy to fix.
- Watch the true volumeNew TypeScript kept arriving; track lines in and out, not just what is left.
- Collapse the seamFinish when no temporary bindings or old call sites remain.
The prompt
Our own prompt, inspired by Stephen Toub and written to work in Microsoft Copilot. Values in lime are placeholders.
We are porting [module] from TypeScript to Rust incrementally. Port only [function or file] in this pull request. Keep its behavior identical, add a temporary binding so existing TypeScript callers still work, and add tests comparing old and new outputs on [fixtures]. Report the current count of temporary bindings and remaining TypeScript call sites.
Inspired by Stephen Toub: Migrating the GitHub Copilot runtime to Rust, using Copilot. The prompt above is written by playbooks.bot in our own words; nothing from the original is quoted.
What can go wrong?
- Initial size estimates were badly misleading because the code grew during the port.
- Running several versions of a component at once was avoided because of merge churn.
Our take
Most teams will never port eight hundred thousand lines, but Stephen Toub's method transfers. Incremental merges into a always-shippable main, a temporary seam of bindings so ported functions can call the old ones, and honest tracking of how much new TypeScript kept arriving during the migration are the practices that matter. The insight that the old codebase grew while the port was underway is a warning for any migration plan that assumes a frozen target. Have the agent produce a daily count of remaining seam functions so progress is visible and morale does not depend on vibes. Keep a human owner for the interface design across the seam; that is where long-term cost lives if the temporary layer becomes permanent. Prefer many small pull requests over heroic branches. Measure runtime behavior, not only compile success, before collapsing each slice of the seam. Document why Rust was chosen so future maintainers know which constraints still apply.
Where the time goes back: Agents make a rewrite that would have needed a team for a year or more affordable for one person in months.
FAQ
How big did the seam get?
Who did the work?
Source and credit
Inspired by Stephen Toub. We describe the idea in our own words, link to the original, and wrote the prompt ourselves; nothing is quoted.
- Inspired by
- Migrating the GitHub Copilot runtime to Rust, using Copilot
- Creator
- Stephen Toub
- Published on
- github.blog
- Original date
- Sep 16, 2026
- License
- Not openly licensed (the poster keeps all rights), so we quote nothing and link to the original
- Originally for
- Microsoft Copilot
- AI dry run
- Oct 23, 2026: passed. Dry-run tested by our AI test agent on sample input. PASS: Gates held on desk check; no live sends or purchases.
AI dry run on sample data; not run with live connected accounts. The playbooks.bot test agent filled the prompt with synthetic inputs, produced the output and checked it against the page's stated outputs and guardrails. - Verified
- Oct 23, 2026: source link resolves to the original, the credited creator published it, our excerpt or prompt matches it, and the license allows our use.
Are you the creator? Claim or correct this page.