Cloudflare and VoidZero are collaborating with Max Schwenk of Owner.com on tsrs, a Rust port of the TypeScript compiler. The work is done in close collaboration with the TypeScript team and is incubated as part of the Oxc JavaScript compiler toolchain. The stated aim is to shorten the time developers spend waiting on type checking, and to make TypeScript leaner in memory so that complete development environments can run in more places, including the browser.

The project is explicitly not a fork of TypeScript. The authors hold that the TypeScript team should keep full control over the language's design and direction, since a port can only stay compatible if it follows the team's decisions closely — including features the team may spend years prototyping before settling on an implementation.

Measured performance and the default profile

Early benchmarks of the Rust port show tsrs running up to 8x faster than TypeScript 7.0 while using roughly 70% less memory, given the same number of type check workers:

TypeScript 7.1 beta is itself up to 2.5x faster than 7.0, and some of those optimizations were upstreamed from tsrs. The authors note that benchmarks of other TypeScript ports often use larger machine types and non-default options; the figures above were agreed with the TypeScript team so that both sides run the same configuration.

Away from the like-for-like comparison, tsrs ships with an adaptive default that depends on the machine type and trades more memory for still more speed:

Installation and the case for Rust

An experimental release is available as the tsrs package on npm:

npm install tsrs
npx tsrs

The Go port of TypeScript has already delivered large speed and memory gains, so the question is what Rust adds. The answer is WebAssembly: compiling a Go program to Wasm means shipping Go's garbage collector with it, whereas Rust's memory model allows straightforward memory interaction between a Wasm guest and host. That memory efficiency is what makes Rust a better fit for the Wasm use case, whether client-side in a browser, on an embedded device, or in an IoT application.

Cloudflare Workers have long supported Wasm, and Cloudflare recently added native Rust support in Workers through a new Emscripten target for wasm-bindgen. Running whole build and deployment systems in tight loops on Workers makes a small memory footprint pay off quickly, to the point where fully encapsulated development systems can run where they previously could not — and combined with agents, a toolchain can run end to end in a sandbox on Cloudflare.

Keeping pace with upstream

Two threads govern maintenance. First, work with Theo Browne will merge tsc-rs and tsrs into a single package covering all of TypeScript's features, including Language Server Protocol and content mappers. Second, the sync process mirrors the one used for Vinext against Next.js:

Each morning, an agent reviews the changes, fetches diffs, and opens tracking issues for anything that could affect Vinext. Every night, the compatibility matrix is regenerated as we run the Next.js test suite against Vinext. When one of these tests or issues reveals a gap, agents are now in the position where they can identify the change across both codebases, build a reproduction, port any relevant tests, and propose a fix.

That process is to be applied to TypeScript with care to avoid diverging behavior, and performance improvements found along the way will be offered back to the TypeScript Go codebase. Some differences remain today — the order in which diagnostics are printed, for instance — and the goal is to minimize them by the stable release.

Where it fits in Cloudflare's stack

Cloudflare already hosts Rust tooling used across the JavaScript ecosystem, among them Vite, Rolldown, Oxlint and Oxfmt, and more than 10 million developers build on its platform. Deeper tsrs integrations are planned, including type-aware lint rules in Oxlint. As with Vinext, the intent is to keep tsrs a well-maintained open source project without getting in the way of TypeScript itself; the Oxc team has begun refactoring the codebase for speed, memory and maintainability, while the TypeScript team experiments with memory and performance improvements for tsc.