Cloudflare has assumed control of tsrs, a Rust-based reimplementation of Microsoft's TypeScript compiler that the company claims delivers up to eight times faster performance while consuming 70% less memory than TypeScript 7.0. The project, which originated at restaurant software company Owner.com last month, is now part of Cloudflare's broader effort to enable AI coding agents to validate their work efficiently without overwhelming computing resources.

Cloudflare's director of engineering Christoph Nakazawa emphasized the distinction between this effort and a traditional fork. "We are not forking TypeScript — we are working with the TypeScript team and as a result 7.1 is already ~2.5x faster, too," Nakazawa stated on X. The collaboration extends to sharing optimizations discovered during the Rust port's development, which are already accelerating Microsoft's own TypeScript 7.1 implementation.

In a joint blog post, Nakazawa alongside Cloudflare engineers Boshen Chen and Dimitri Mitropoulos reiterated their commitment to Microsoft's leadership of the language. "To be clear, we are not forking TypeScript. We believe the TypeScript team should remain in full control of the language's design and direction. They have maintained a long-term vision while guiding TypeScript's adoption across the JavaScript community. We do not want to change that."

https://x.com/cnakazawa/status/2112531228981366863?ref_src=twsrc%5Etfw

Why Rust instead of Go?

TypeScript, released by Microsoft in 2012, augments JavaScript with static typing to help developers identify errors before execution. Type checking can demand substantial computational resources, especially in large codebases where multiple AI agents simultaneously write and validate code. Microsoft tackled performance issues in July by releasing TypeScript 7.0, which replaced its JavaScript-based compiler with a Go implementation that achieved roughly tenfold speed improvements.

Microsoft had previously evaluated Rust for this rewrite but determined that reconstructing TypeScript's existing design in Rust would create substantial obstacles related to memory management and backward compatibility. The performance metrics from tsrs present a striking contrast with Microsoft's Go compiler. Daniel Rosenwasser, Microsoft's principal product manager for TypeScript, acknowledged in a Hacker News discussion that "a lot of the speed does not just come down to language choice," and noted that "some of what is going to make TS 7.1 faster and leaner… actually comes from optimizations discovered in tsrs." Rosenwasser also announced TypeScript 7.1 beta, which includes significant performance and memory enhancements.

Cloudflare sees particular advantages in Rust's compatibility with WebAssembly. While Go can compile to Wasm, it must include its garbage collector in the process. Rust provides finer-grained memory control, reducing the overhead of running development tools in memory-limited settings. This capability could enable Cloudflare to deploy complete development environments within browsers and isolated Workers sandboxes, allowing AI agents to write, validate, and construct applications with minimal resource constraints.

The initiative aligns with Cloudflare's expanding JavaScript ecosystem. The company has been assembling JavaScript tools and expertise, including its acquisition of VoidZero in June and the launch of Void, an open-source platform for deploying AI-generated applications. The Cloudflare and VoidZero teams are now advancing tsrs as part of Oxc, VoidZero's Rust-based JavaScript toolchain, with intentions to incorporate it into additional developer tools.

From Owner.com to Cloudflare: The tsrs origin

The tsrs project launched just last month at Owner.com, where Max Schwenk, head of AI developer experience, encountered a 37,000-file TypeScript backend. Microsoft's Go compiler required 19 GiB of memory and consumed 80 seconds for a single-threaded type check, limiting how many coding agents could operate in parallel. With multiple agents generating code at once, the resource demands prevented each from independently validating its changes, pushing Owner.com toward cloud-based development environments and other workarounds.

Schwenk wrote that "For a coding agent to be maximally productive, it needs to be able to validate its work in the tightest possible loop." After hitting walls while attempting to reduce the Go compiler's memory footprint, he pursued a more ambitious approach: leveraging Anthropic's Claude Opus 5.5 to rebuild the compiler in Rust. Schwenk directed the experiment and assessed the results while delegating implementation entirely to AI agents.

Schwenk reported that "I wrote zero code. Not 'barely any'. Zero." The outcome arrived with remarkable speed. Schwenk deployed more than 20 AI subagents in parallel and woke the next morning to a functioning typechecker. Subsequent refinements reduced Owner.com's typechecking time to approximately seven seconds in CI. Across more than a dozen public projects, Schwenk documented tsrs running 2.5 to five times faster than Microsoft's newer Go compiler nightly, while consuming roughly one-third the memory.

Agentic rewrites in Rust

The tsrs project represents one of several substantial Rust migrations powered by AI agents. GitHub deployed its own Copilot agents to rewrite its coding-agent runtime in Rust, while Anthropic previously used Claude agents to assist in migrating its Bun JavaScript runtime from Zig to Rust. Meta employed AI to help port the React Compiler to Rust, and in September OpenAI disclosed that two engineers used Codex and GPT-5.5 to reconstruct its Habitat storage service in Rust.

However, rapid AI-assisted rewrites introduce concerns about verifying that the resulting code functions correctly. For a TypeScript compiler, this means confirming it identifies the same errors as Microsoft's version. Schwenk indicated the project relies on TypeScript's conformance tests, deliberately injects errors into real projects, and runs Miri, a Rust tool for identifying memory-safety issues. These validation steps have already caught a memory bug that surfaced only in optimized builds.

Schwenk emphasized that "A faster compiler that finds fewer errors is a broken compiler with good marketing." Sustaining compatibility will prove an ongoing undertaking. Cloudflare intends to adopt the AI-assisted methodology behind Vinext, its Vite-based reimplementation of the Next.js web framework, where agents track Next.js for modifications, execute compatibility tests, and suggest corrections when divergences surface. Some inconsistencies persist in tsrs, such as the sequence in which diagnostic messages appear.

The Cloudflare authors stated that "We will apply the same process to TypeScript, taking extreme care that we don't introduce diverging behaviors from upstream TypeScript."