The Major Transition to Rust
Microsoft has opted to give GitHub Copilot a complete Rust refresh. They’ve sidelined TypeScript and brought Rust into the fold, with AI agents shouldering much of the workload. This set them back about $120K on AI tokens along with a few weeks of a developer’s valuable time. Keep in mind, some managers had to grapple with regression issues – it appears AI isn’t fully fluent in Rust just yet.
The Conversion Odyssey
Microsoft’s transformation journey unfolded over 14.5 weeks with more than 135 releases. AI agents initiated around 1.3 port pull requests each day, translating 430,000 lines of TypeScript into an astonishing 800,000 lines of Rust. They maintained a simple approach, addressing modules individually without altering the runtime framework. That’s a task for another time.
Rust’s Enhanced Performance
Rust’s capability has proven to be a true powerhouse. It outperformed the TypeScript equivalent, completing 1,000 lifecycles at an incredible rate – 15.9 times faster. In terms of memory usage, Rust required just 126 MB compared to TypeScript’s voracious 1,383 MB for the same task. That’s quite something. No more external processes like TypeScript needed; everything operates seamlessly in-process.
Copilot’s Expansion from VS Code to Microsoft Office
Many may not realize how far-reaching Copilot is. It’s embedded in everything from VS Code and Visual Studio to Excel and PowerPoint, all previously developed in TypeScript. TypeScript and Node served well for rapid development, but at larger scales, they fell short. Enter Rust—perfect for integration through a C ABI, with low startup requirements and predictable resource management.
AI’s Conversational Makeover
They utilized Copilot to adorn itself with a Rusty new veneer. The endeavor resembled a detective story with agents delving into documentation and collaborating energetically. Their focus was more on research rather than merely producing lines of code. These well-read but chatty agents took their time converting the ‘session.ts’ file, a formidable beast exceeding 30,000 lines.
Collaboration and Coordination
The AI agents were quite sociable, initiating sessions and conversing with others for better coordination. One session continued with 25 hours of work, beginning with 56 minutes spent reading documents and making 122 tool calls—what an initiation!
The Compiler Puzzle
Rust has gained popularity for rewriting code, but it has its own peculiarities. Just because the code compiles doesn’t guarantee everything is rosy. Toub uncovered regressions hiding within the code. Hidden perils of Rust, right? It’s like treating the compiler as a mentor rather than a sage, assisting you in grasping the language’s complex subtleties, in contrast to those AI agents mindlessly hammering away until something works.
A Note of Caution
At RustConf, consultant Lisa Crossman issued a caution: the compiler won’t rescue you from crafting the wrong program accurately. Human developers can navigate it, but AI? Well, they tend to be clumsy. Toub suggests that compiler-validated regressions stem from various chaotic sources, ambiguous semantics, and absent features that didn’t make the transition.
Conclusion: Rusty Journeys Come at a Cost
So, there you have it, everyone. Microsoft’s hefty investment in Rust for Copilot revealed that the journey isn’t without its challenges. It’s fast, efficient, and a memory saver, but achieving this meant traversing a landscape filled with AI idiosyncrasies and compiler conundrums. It might represent a substantial technological leap, but it certainly cost them quite a bit – along with a few headaches.
For more tech stories and witty banter, visit gadgetlad.co.uk.
