NEWS

Cloudflare releases tsrs, a Rust port of TypeScript written by AI agents

The numbers are impressive, but a compatibility detail has already caught people off guard in CI.

Cloudflare releases tsrs, a Rust port of TypeScript written by AI agents
Image: Redação iMasters

The numbers are impressive, but a compatibility detail has already caught people off guard in CI.

Editor's note: two points in this text could not be fully confirmed in the original source (InfoQ). The chart caption mentions specific versions (TypeScript 7.0.2, nightly build) and project names used in the tests (VS Code, MUI docs, webpack, t3code server) that do not appear in the source's own image description. Also, the sentence about the memory model explicitly citing a "language server running all day in the editor" is an elaboration by the author based on a more generic criticism from the source, which only questions whether the model is safe for prolonged use. We keep the text as is, but the reader should consider these two points as unverified details, not as central facts of the announcement.

The numbers are impressive, but a compatibility detail has already caught people off guard in CI.

Cloudflare and VoidZero introduced tsrs, a TypeScript compiler rewritten in Rust by AI agents. The numbers are impressive, but a compatibility detail has already caught people off guard in CI.

On October 27, 2026, Cloudflare introduced tsrs, a Rust port of the TypeScript compiler, developed in partnership with VoidZero and Max Schwenk, an engineer at Owner.com. The project lives inside the Oxc toolchain and, according to Cloudflare, was built in close collaboration with the TypeScript team at Microsoft. The company is careful to stress that this is not a fork: full control over the language's design remains with the official TypeScript team (InfoQ).

Why this isn't just another fork

tsrs enters territory that already had two occupants: tsgo, Microsoft's official port written in Go, and tsc-rs, a parallel project by Theo Browne also in Rust. Instead of competing for space, Cloudflare announced that it will merge tsc-rs and tsrs into a single package, combining language server and content mapper support. In other words: the ecosystem of alternative TypeScript compilers is converging, not multiplying.

Written by agents, not by a team of engineers

The most striking detail of the announcement is how tsrs was made. Schwenk says he wrote "zero" lines of code: he directed AI agents led by Claude Opus 5.5 to produce a faithful port of the compiler, using TypeScript's own 15,197 conformance tests as the reference specification.

The practical result showed up in Owner.com's 37,000-file monolith: a type check that consumed 19 GiB of memory and took 80 seconds on TypeScript 7.0 dropped to 7 seconds with tsrs. This is the kind of gain that justifies the interest of those maintaining large codebases in production.

The numbers check out, but it depends on what you compare them to

Cloudflare reports up to 8x faster type checking and about 70% less memory use compared to TypeScript 7.0, with the same number of checker workers. An independent developer replicated the test on their own and arrived at similar numbers: 5.3x faster and 72% less memory, with identical diagnostics and byte-for-byte emission matching tsc.

Chart compares tsrs compilation time and peak memory against TypeScript 7.0.2 and nightly across projects such as VS Code, MUI docs, webpack, and t3code server
Chart compares tsrs compilation time and peak memory against TypeScript 7.0.2 and nightly across projects such as VS Code, MUI docs, webpack, and t3code server. Reprodução: infoq.com.

The important caveat came next: when measured against the beta version of TypeScript 7.1 (newer than the 7.0 used in the official benchmark), a user identified as ImportStatic recorded a smaller gain, 2.7x. In other words, the headline number (8x) is real, but it was measured against a baseline that is already falling behind.

A detail that can silently break your CI

The same independent benchmark found an incompatibility that doesn't appear in any official announcement: tsrs exits with code 2 when it finds a type error, while tsc has always exited with code 1. CI scripts that specifically check for code 1 (instead of any nonzero value) may fail to detect the error and let builds with type errors pass unnoticed.

It's the kind of detail that only surfaces when someone outside actually puts it to the test, and it reinforces why swapping the compiler of a production project isn't a decision you make with npm install without reviewing the entire pipeline.

The TypeScript team itself responds

Daniel Rosenwasser, of the TypeScript team at Microsoft, commented on the announcement publicly.

does not just come down to language choice

Daniel Rosenwasser, TypeScript team, Microsoft

According to him, some of the optimizations discovered while building tsrs are being folded back into TypeScript itself, feeding into a leaner version of TypeScript 7.1. This means that even those who don't switch compilers may feel part of the performance gain just by waiting for the next official release.

Not everyone received the project with unconditional enthusiasm. Part of the community questioned whether tsrs's memory model, based on arenas that are never freed during execution, is safe for long-running processes, such as a language server running all day inside the editor.

Enthusiasm showed up too, and fast

Peter Steinberger, a developer known for tools such as PSPDFKit, posted a real migration account on X.

Moved to tsrs over the weekend. Drop-in replacement. Around 5x faster for OC. Kind of amazing that it took Microsoft a team and two years to rewrite the TS compiler in go, and now you can just let an agent rip and get sth significantly better within weeks.

Peter Steinberger, via X

The contrast between this euphoria and the distrust around the memory model sums up the moment well: tsrs works, but it hasn't yet accumulated the production track record that tsc and tsgo have.

How to test it and what's still missing

To try it out, just point it at an existing tsconfig:

npm install -D tsrs
npx tsrs -p . --noEmit

The project also exposes @tsrs/wasm, allowing you to compile to WebAssembly and run type checking directly in the browser or on Cloudflare Workers, without dragging a garbage collector into the bundle the way a Go binary would.

Even so, tsrs is experimental. There's no watch mode or working language server, the --init and --showConfig flags aren't supported, and the order of diagnostics can differ from tsc. Since tsrs tracks TypeScript 7, teams still on TypeScript 5 or 6 should first migrate to Microsoft's official tsgo before considering tsrs; after that, the switch reuses the same existing tsconfig.

The code is open source under the Apache-2.0 license and available on GitHub. For those maintaining large TypeScript monoliths, tsrs is already worth watching closely, but the decision to put it into production still runs into concrete tooling gaps and an open question about memory that only real-world usage over time will answer.

Translated from the Brazilian Portuguese original · Read the original