Independent tech intelligence, checked against primary sources.

TechPulseMind Useful technology.
No manufactured hype.

tsrs: Cloudflare and VoidZero Port TypeScript to Rust, Up to 8x Faster

Cloudflare and VoidZero announce tsrs, a Rust port of the TypeScript compiler, claiming up to 8x faster performance and ~70% less memory than TypeScript 7.0.

tsrs: Cloudflare and VoidZero Port TypeScript to Rust, Up to 8x Faster

Cloudflare and VoidZero are working with Max Schwenk of Owner.com on tsrs, a Rust port of the TypeScript compiler, the companies announced on the Cloudflare blog. The project is being incubated as part of the Oxc JavaScript compiler toolchain, in close collaboration with the TypeScript team.

You can try an experimental release now by installing the package from npm:

npm install tsrs
npx tsrs

According to Cloudflare, early benchmarks show tsrs is up to 8x faster and uses roughly 70% less memory than TypeScript 7.0 when both use the same number of type check workers. The company says it worked with the TypeScript team so the benchmarks compare the same configuration.

Not a fork, and the Go port is still faster

Cloudflare is explicit that this is not a fork. “We believe the TypeScript team should remain in full control of the language’s design and direction,” the post states, adding that the port has to follow the team’s decisions closely or it will eventually become incompatible.

The post also credits the TypeScript team’s own port from JavaScript to Go, calling it the only successful attempt among many over the years, and notes that port already made TypeScript about 10x faster. The next TypeScript release brings more gains of its own: TypeScript 7.1 beta is up to 2.5x faster than 7.0, and Cloudflare says some of those optimizations were upstreamed from tsrs.

Why Rust: WebAssembly and memory

Cloudflare frames Rust as more than a speed choice. Compiling a Go program to WebAssembly means compiling Go’s garbage collector along with it, while Rust’s memory management model allows straightforward memory interactions between a Wasm guest and host. Cloudflare says that memory efficiency makes Rust a better fit for the browser and for Workers, which have long supported Wasm and recently gained native Rust support through a new Emscripten target.

By default, tsrs ships with an adaptive configuration that depends on the machine type and uses more memory in exchange for being even faster, according to the post.

The experimental package is available on npm as tsrs. Given the project’s stated goal of staying faithful to the TypeScript team’s implementation, expect the port to track upstream decisions rather than chart its own course.

Related reading

Sources

Some links on this page may be affiliate links. If you buy through them we may earn a commission at no extra cost to you. See our affiliate disclosure.