Cloudflare takes over tsrs, a Rust port of the TypeScript compiler

Some 37,000 files make up the backend that Max Schwenk worked on at Owner.com, a provider of restaurant software. Checking it with TypeScript 7.0 took 19 GB of memory and 80 seconds in a single thread, and left little room for coding agents running in parallel. Schwenk is responsible for the company's AI developer tools there. In late September he launched an open-source project meant to solve this bottleneck: tsrs.
The TypeScript compiler is the tool that checks code. Microsoft wrote it in Go. tsrs translates this implementation function by function into Rust and is meant to replace both the compiler and the language server, that is, the component that supplies editors with error messages and suggestions. Cloudflare justifies the need for a Rust version after the Go port with WebAssembly (Wasm). A Go program compiled to Wasm has to bring its own garbage collector, the automatic memory management. Rust needs none and, according to Cloudflare, saves memory accordingly.
The most striking figures come from Cloudflare: type-checking up to eight times as fast as TypeScript 7.0 and about 70% less memory, when both run with the same number of threads. The project founder's measurements are more restrained and are taken against the current state of Microsoft's Go compiler: on 17 open-source projects, tsrs is two and a half to five times as fast and uses roughly a third of the memory. On the same Tuesday, Microsoft released the beta of TypeScript 7.1, which needs 13% to 47% less time for type-checking than TypeScript 7.0 across five codebases measured by the company. Daniel Rosenwasser from the TypeScript team confirms in a comment on Hacker News that part of these gains is due to the optimizations in tsrs. His team has experimented with Rust itself and suspects that much of the speed has far less to do with the language than one might assume.
The port was built with the help of AI, specifically Anthropic's Claude Opus 5.5. Schwenk himself, he says, did not write a single line of code. The project documentation reports that tsrs matches the original on almost all error baselines in TypeScript's conformance test suite, a collection of test runs that measure behavior against the original. The team attributes a few deviations to the test environment. Schwenk explains the handover to the Oxc team by saying he wanted to put the project in the hands of people who maintain Rust tooling professionally.
For Cloudflare, the gain has a concrete target: the Workers platform is meant to let AI agents run complete development toolchains in isolated environments, and in that setting every gigabyte of memory counts. Developer teams can already try tsrs today: as an npm package under the Apache License 2.0, with native binaries for macOS on ARM processors and for Linux, but not for Windows. Version 0.18 is considered experimental. The team aims for a stable version with full compatibility with TypeScript 7.1 but has not named a date. The language itself remains with the TypeScript team at Microsoft; Cloudflare rules out a fork. To keep the port in step with Microsoft's changes, AI agents are to review the TypeScript repository daily and suggest matching fixes.
Sources — read the originals(Paris time)
Read next
Comments
Loading the thread…
Sign in to leave a comment. Sign in