logo
Kurashizu Blogwhere ideas flow
  • Home
  • News
  • Blog
  • About
  • Home
  • News
  • Blog
  • About

© 2026 Kurashizu. All rights reserved.

Admin·New Post·Service Status
Powered by Cloudflare·27.10.26
← Back to news

Tsrs: A Port of TypeScript to Rust

Original article
blog.cloudflare.com|178 points|90 comments|by hnisjafx40|Oct 20, 2026

Introducing tsrs: A Rust-Based Port of TypeScript

Cloudflare and VoidZero, in partnership with Max Schwenk from Owner.com, are excited to announce tsrs—a comprehensive port of the TypeScript compiler written in Rust.

This project is being developed in tight coordination with the official TypeScript team and is currently being incubated as a component of the Oxc JavaScript toolchain.

The Core Mission

Our primary objective is to minimize the time developers spend waiting for type-checking to complete, allowing them to focus on actual creation. By enhancing memory efficiency and execution speed, we can bring full-scale development environments to new frontiers, including directly inside the web browser.

Our Philosophy on Governance: We believe the TypeScript team must retain absolute authority over the language's evolution and design. Their long-term stewardship has been vital to TypeScript's widespread adoption. Because the official team often spends years prototyping and refining features, tsrs must mirror those decisions exactly to avoid divergence incompatibility.


Performance and Memory Metrics

Initial benchmarks indicate that tsrs offers significant improvements over TypeScript 7.0. When utilizing an identical number of type-check workers, the results are as follows:

MetricTypeScript 7.0tsrs (Rust Port)Improvement
Execution SpeedBaseline≈8×\approx 8\times≈8× Faster↑\uparrow↑ Significant
Memory UsageBaseline≈30%\approx 30\%≈30% of Original↓70%\downarrow 70\%↓70% Reduction

Note: TypeScript 7.1 beta already shows internal gains, performing up to 2.5×2.5\times2.5× faster than version 7.0. Some of these improvements were actually derived from tsrs optimizations that were upstreamed.

To ensure accuracy, we collaborated with the TypeScript team to standardize configurations, avoiding the common pitfall of comparing different machine types or default settings. While tsrs offers a standard mode, it also includes an adaptive configuration that leverages more memory for even greater speed depending on your hardware.

Give it a Try

tsrs aims to be a mirror image of the original compiler. You can test the experimental build via npm:

# Install the package
npm install tsrs

# Execute the compiler
npx tsrs

Why Transition to Rust Now?

Historically, porting TypeScript has been a monumental task. In fact, only one major effort succeeded: the official team's transition from JavaScript to Go. However, the landscape has changed because:

  1. AI Acceleration: Modern frontier AI models can now handle massive porting tasks almost autonomously in a few days.
  2. Diverse Implementations: We are now seeing a surge of "slopforks," faithful ports, and total architectural rewrites in C++ and Rust.

The Wasm Advantage: Rust vs. Go

You might wonder why a Rust port is necessary if the Go port already provided a 10×10\times10× speed boost. The answer lies in WebAssembly (Wasm).

  • Go: Requires compiling the garbage collector (GC) into the Wasm binary.
  • Rust: Its memory model allows for direct, efficient interaction between the Wasm guest and the host.

This makes Rust the superior choice for memory-constrained environments. With Cloudflare's recent support for native Rust in Workers (via the wasm-bindgen Emscripten target), we can now run entire build systems in tight loops.

Wasm Memory Efficiency Concept

This efficiency enables sandboxed, end-to-end development toolchains on Cloudflare, which can be deployed to:

  • Client-side browsers
  • Embedded devices
  • IoT applications

The Path Forward

Our strategy for maintaining parity and expanding functionality involves a two-pronged approach:

1. Feature Integration

We are collaborating with Theo Browne to merge tsrs and tsc-rs into a unified package. This will ensure support for:

  • The Language Server Protocol (LSP)
  • Content mappers
  • Full TypeScript feature parity

2. The Sync Engine

To prevent the port from drifting, we are implementing an automated synchronization pipeline similar to how we manage Vinext relative to Next.js.

The Daily Workflow:

  • Morning: Agents analyze upstream changes and flag potential impacts.
  • Night: The compatibility matrix is updated by running the official TypeScript test suite against tsrs.
  • Resolution: Agents identify the delta, build a reproduction case, and propose the necessary code port.

Final Goals

  • Eliminate discrepancies in diagnostic print ordering.
  • Reach a stable release with minimal divergence from upstream.
  • Upstream performance wins back to the TypeScript Go codebase.

Cloudflare continues to champion the Rust ecosystem with tools like Vite, Rolldown, Oxlint, and Oxfmt. For our 10 million+ developers, tsrs represents the next step in making the JavaScript toolchain faster, more portable, and more accessible.