deniz.in

Markets

Weather

Loading weather

· via Cloudflare blog

Cloudflare and VoidZero port TypeScript to Rust in tsrs, with up to 8x faster type checking

Cloudflare and VoidZero are building tsrs, a Rust port of the TypeScript compiler made with the TypeScript team; early benchmarks show type checking up to 8x faster with about 70% less memory.

Cloudflare and VoidZero port TypeScript to Rust in tsrs, with up to 8x faster type checking

Cloudflare and VoidZero announce tsrs, a Rust port of TypeScript

Cloudflare, working with VoidZero and Max Schwenk of Owner.com, has announced tsrs, a port of the TypeScript compiler to Rust. According to the Cloudflare blog post, the project is being incubated inside the Oxc JavaScript compiler toolchain and built in close collaboration with the TypeScript team, with the stated goal of letting developers spend less time waiting on type checks.

A port, not a fork

Cloudflare is emphatic that tsrs is not a fork. The company says the TypeScript team should remain in full control of the language's design and direction, and that a Rust implementation must track that team's decisions closely — some of which take years of prototyping to settle — or it will eventually break compatibility. tsrs is therefore intended to reproduce TypeScript exactly as the original implementation defines it, with the TypeScript team as the sole authority on what that means.

Early benchmarks

According to Cloudflare's early numbers, tsrs is up to eight times faster and uses roughly 70 percent less memory than TypeScript 7.0 when both run with the same number of type-check workers. The baseline itself keeps moving: Cloudflare says the TypeScript 7.1 beta is already up to 2.5 times faster than 7.0, and some of those optimizations originally came from tsrs, with more contributions hoped for.

Cloudflare also cautions that recent benchmarks of other TypeScript ports have often reflected larger machines or non-default settings rather than like-for-like comparisons, and says it worked with the TypeScript team to keep configurations identical for these figures. By default, tsrs ships a configuration that adapts to the host machine, trading extra memory for additional speed. An experimental release is available on npm: install the tsrs package and run it with npx.

Why Rust, when Go already worked

As Cloudflare tells it, only one previous attempt at porting TypeScript to another language succeeded: the TypeScript team's own rewrite from JavaScript to Go, which delivered major performance and memory gains. The argument for Rust is less about raw speed than about WebAssembly. A Go program compiled to Wasm brings Go's garbage collector along for the ride, while Rust's memory model allows direct, uncomplicated memory interaction between a Wasm guest and its host.

That distinction matters to Cloudflare because Workers has supported Wasm for a long time and recently added native Rust support through a new Emscripten target for wasm-bindgen. A small memory footprint makes it practical to run whole build and deployment pipelines on Workers, and Wasm allows those environments to run safely in a browser, on an embedded device or in IoT contexts — including full development toolchains inside sandboxes, driven by AI agents.

Cloudflare also explains the timing: past porting attempts mostly failed under the complexity involved, but frontier AI models can now complete large-scale ports almost unaided in a matter of days, producing everything from careless forks to careful ports, and signaling broad demand for a faster TypeScript.

Staying in sync with upstream

Maintenance rests on two tracks. First, Cloudflare is working with Theo Browne to merge tsc-rs into tsrs, producing a single package that covers all of TypeScript's features, including Language Server Protocol support and content mappers. Second, it will reuse the process behind Vinext, which Cloudflare keeps aligned with its upstream, Next.js: every morning an agent reviews upstream changes and opens tracking issues, and every night the Next.js test suite runs to regenerate a compatibility matrix. When a gap appears, agents locate the change in both codebases, build a reproduction, port relevant tests and propose a fix.

The same loop will run against TypeScript, and performance improvements will be offered back to TypeScript's Go codebase so all users benefit. Some differences exist today — the order in which diagnostics are printed, for example — and Cloudflare aims to shrink them to a minimum before a stable release.

Why it matters

Type checking sits on the critical path of most TypeScript workflows, so an implementation that is dramatically faster and leaner directly shortens feedback loops — and improvements upstreamed into official TypeScript help everyone, not just tsrs adopters. The WebAssembly angle could push full type-aware toolchains into browsers, edge runtimes and embedded devices, enabling in-browser development environments and sandboxed agents that build and check code without a dedicated server. The agent-driven process for tracking upstream changes is itself notable as a template for keeping ports of fast-moving projects compatible. Cloudflare, which already maintains Rust tooling for the JavaScript ecosystem such as Rolldown, Oxlint and Oxfmt and says more than 10 million developers build on its platform, also floats deeper integrations down the line, such as type-aware lint rules in Oxlint.

  • #typescript
  • #rust
  • #cloudflare
  • #webassembly
  • #developer-tools

Related posts