AI & Development Tools
Cloudflare launches AI-built Rust compiler for TypeScript, bridging performance gap for coding agents
A new Rust implementation of TypeScript runs up to eight times faster and uses 70% less memory than the original, created entirely by AI agents and aimed at scaling developer tooling for agentic workflows.
1/2
The New Stack
Cloudflare is driving adoption of a high-performance TypeScript compiler rewritten in Rust, addressing a critical bottleneck for AI coding agents that need to validate work without consuming prohibitive computing resources. The project, called tsrs, delivers dramatic speed and memory improvements while maintaining compatibility with Microsoft's language specification.
The initiative marks a significant shift in how companies approach large-scale migrations: the entire Rust port was written by AI agents, not human engineers. Yet Cloudflare is careful to frame this as a collaboration, not a replacement—Microsoft retains ownership of TypeScript's direction, and both teams are actively sharing performance insights to improve the broader ecosystem.
The problem: Resource strain on agentic workflows#
TypeScript has become essential for catching programming errors before runtime, but its type-checking process demands considerable computational power. This constraint becomes acute when multiple AI agents are simultaneously writing and validating code within the same project. The challenge came into sharp focus at Owner.com, where using Microsoft's newer Go-based TypeScript compiler on a 37,000-file backend consumed 19 gigabytes of memory and took 80 seconds per check—severely limiting how many agents could work in parallel.
Max Schwenk, Owner.com's head of AI developer experience, recognized that coding agents operate most effectively when they can verify their changes in tight feedback loops. Under those constraints, that became nearly impossible.
How AI built a better compiler#
Rather than attempting to optimize the existing Go implementation, Schwenk decided to use Anthropic's Claude Opus 5.5 to recreate the compiler from scratch in Rust. He orchestrated the effort but wrote none of the code himself—over 20 AI subagents worked in parallel, and by the following morning a functional type-checker emerged.
The results exceed expectations: tsrs runs 2.5 to 5 times faster than Microsoft's latest nightly build while consuming roughly one-third the memory. Cloudflare, which has been expanding its JavaScript ecosystem through acquisitions like VoidZero, took ownership of the project and is integrating it into Oxc, a Rust-based toolchain for JavaScript development.
Why Rust over Go?#
Microsoft initially chose Go for its TypeScript rewrite in July, delivering roughly tenfold performance gains over the JavaScript original. Rust, however, offers Cloudflare a specific advantage: superior WebAssembly compatibility. While Go can compile to Wasm, it carries its garbage collector along, increasing runtime overhead. Rust's direct memory control enables lighter-weight execution in browser-based environments and Cloudflare Workers sandboxes—exactly where Cloudflare wants to run complete development workflows for AI agents.

