Cloudflare announced tsrs, a Rust port of the TypeScript compiler built within the Oxc toolchain in collaboration with VoidZero, Owner.com’s Max Schwenk, and the TypeScript team. Early benchmarks validated with the TypeScript team show tsrs up to 8x faster and using 70% less memory than TypeScript 7.0 with the same number of type-check workers, and an even faster adaptive default configuration. The project is not a fork; the TypeScript team retains full authority over language design, and tsrs maintains strict behavioral compatibility via a nightly automated process that reviews upstream diffs and runs the TypeScript test suite. Rust’s memory model, lacking a garbage collector, enables efficient WebAssembly execution, allowing TypeScript environments to run in browsers or Cloudflare Workers without heavy overhead. Future plans include merging with tsc-rs for complete LSP support, adding type-aware lint rules to Oxlint, and contributing performance improvements back to TypeScript’s Go codebase.
Context
tsrs is a Rust port of the TypeScript compiler developed by Cloudflare in collaboration with VoidZero, Max Schwenk, and the TypeScript team, incubated within the Oxc JavaScript compiler toolchain. The project aims to reduce TypeScript checking time and memory usage, enabling development environments to run efficiently in browsers via WebAssembly. Cloudflare emphasizes that this is not a fork; the TypeScript team retains full control over language design. The port is enabled by frontier AI models that can perform large-scale codebase ports, and it joins other Rust-based tools in Cloudflare’s ecosystem like Vite, Rolldown, Oxlint, and Oxfmt.
Approach / What changed
tsrs ports TypeScript’s compiler to Rust within the Oxc toolchain, maintaining strict behavioral compatibility through a nightly automated process that reviews upstream diffs, runs the TypeScript test suite, and opens tracking issues for divergences. The project merges with tsc-rs to cover all features including LSP. An adaptive default configuration uses more memory for higher speed. Benchmarks are performed with identical worker configurations, validated with the TypeScript team.
Takeaways
1
tsrs is up to 8x faster and uses 70% less memory than TypeScript 7.0 when using the same number of type-check workers, with an adaptive default mode offering further speed at the cost of additional memory.
2
Rust’s memory model enables efficient WebAssembly execution, allowing full TypeScript development environments to run in browsers or Cloudflare Workers without a garbage collector overhead.
3
The tsrs port is maintained through an automated nightly process that diffs upstream TypeScript changes, runs compatibility tests, and opens tracking issues to prevent behavioral divergence, with plans to merge with tsc-rs.
FAQ
Is tsrs a fork of TypeScript?
No, tsrs is not a fork. The TypeScript team retains full control over language design and direction. Cloudflare collaborates with them to maintain strict behavioral compatibility while porting to Rust.
Why choose Rust over Go for TypeScript?
Go's TypeScript port already offers 10x speed, but Rust's memory model provides superior WebAssembly integration without a garbage collector. This enables TypeScript environments to run efficiently in browsers and edge workers, which is harder with Go's WebAssembly support.
How does tsrs stay compatible with upstream TypeScript?
tsrs uses a nightly automated process: each morning an agent reviews upstream diffs and opens tracking issues for any changes that could affect tsrs. Each night the compatibility matrix regenerates by running the TypeScript test suite against tsrs, ensuring behavioral fidelity.
A bytecode interpreter is a compiler's output plus a loop that runs it. This explainer maps its five parts — bytecode, dispatch loop, runtime state, and the host boundary — and why the shape repeats.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.