Saturday, November 14, 2026

tsrs: TypeScript in Rust

"Everything that can be rewritten in Rust, will be..."

TS compiler was just re-written in Go from TS, making it 10x faster.

But apparently Rust port is even much faster and more memory efficient!

 Introducing tsrs: a Port of TypeScript to Rust | Cloudflare Blog


Cloudflare, VoidZero, and Max Schwenk of Owner.com are collaborating on tsrs, a new Rust port of the TypeScript compiler. Incubated as part of the Oxc JavaScript compiler toolchain, the project is being developed in close cooperation with the TypeScript team. The creators emphasize that they are not forking TypeScript; the official TypeScript team retains full control over the language's design and direction, while tsrs strictly follows upstream implementations.

Key Performance & Memory Gains

  • Speed and Efficiency: Early benchmarks show tsrs is up to 8x faster and uses roughly 70% less memory compared to TypeScript 7.0 (using the same number of type check workers).

  • Upstream Contributions: Some optimizations developed for tsrs have already been upstreamed into official TypeScript releases (such as the TypeScript 7.1 beta).

Why Rust?

While the official Go port made TypeScript significantly faster than its original JavaScript implementation, Rust provides a critical advantage: WebAssembly (Wasm) support.

  • Unlike Go, which requires bundling a garbage collector when compiled to Wasm, Rust’s memory management allows for seamless, memory-efficient interaction between a WebAssembly guest and host.

  • This makes tsrs ideal for running sandboxed development environments and toolchains client-side in browsers, embedded devices, IoT applications, or tightly integrated on Cloudflare Workers.

Maintenance Strategy

  • Consolidation: The team is working with Theo Browne to merge tsc-rs and tsrs into a single package supporting all features, including the Language Server Protocol (LSP).

  • Automated Syncing: Similar to Cloudflare's approach with Vinext (their Next.js sync project), agents will run daily checks, diff reviews, and test suites against upstream TypeScript to prevent behavioral drift.

Getting Started

Developers can experiment with an early release of the package via npm using:

Bash
npm install tsrs
npx tsrs

No comments: