"Everything that can be translated to Rust, will be translated to Rust, by AI Agents :)
Migrating the GitHub Copilot runtime to Rust, using Copilot - The GitHub Blog @GitHub
The GitHub Copilot CLI, GitHub Copilot app, and GitHub Copilot SDK are all backed by the Copilot agent runtime, an agentic harness that can be embedded into applications and services. It was originally written in TypeScript on Node.js and the V8 JavaScript engine for what is now the GitHub Copilot cloud agent (CCA), and the runtime stayed on that stack as the runtime and its capabilities grew rapidly.- The Catalyst: The original TypeScript/Node.js runtime required SDK consumers in different languages (C#, Python, Go, etc.) to spawn a separate Node process. This out-of-process architecture caused high memory overhead, slow startup times, and serialization bottlenecks.
- Why Rust: Rust provided a way to build a pure native binary that could be embedded in-process via a C ABI, offering low overhead, predictable resource use, and superior performance without forcing consumers to ship a full Node.js environment.
- The Strategy: Instead of a risky "big bang" rewrite, the team used an incremental, in-place port. Over 14 weeks and 128 pull requests, they replaced TypeScript components piece by piece, using a temporary interop layer (
napi-rs) to let the new Rust code and old TypeScript code communicate until the TypeScript was fully phased out. - The AI Impact: AI agents wrote the vast majority of the code. A rewrite of this scale—resulting in over 800,000 lines of production Rust—would have previously taken a whole team a year or two. With Copilot, it was completed primarily by a single developer in just a few months, yielding orders of magnitude in performance improvements.
No comments:
Post a Comment