A Rust port of TypeScript
Cloudflare and VoidZero announced tsrs, a project that ports the TypeScript compiler to Rust. The work is being done with Max Schwenk of Owner.com, in close collaboration with the TypeScript team, and is incubated as part of the Oxc JavaScript compiler toolchain.
The teams stress that they are not forking TypeScript. They say the TypeScript team should remain in full control of the language's design and direction, and that a Rust port has to follow those decisions closely or it will eventually become incompatible.
Early performance results
With the same number of type-check workers, early benchmarks show tsrs is up to 8x faster and uses roughly 70% less memory than TypeScript 7.0. TypeScript 7.1 beta is itself up to 2.5x faster than 7.0, and some of those optimizations were upstreamed from tsrs.
The teams say the comparisons use the same configuration and were validated with the TypeScript team. By default, tsrs ships with an adaptive configuration based on machine type that uses more memory but runs even faster.
Why Rust?
TypeScript's Go port already delivered major speed gains. Rust's standout advantage is WebAssembly: compiling a Go program to Wasm also brings Go's garbage collector along, while Rust's memory model enables more efficient memory interaction between a Wasm guest and host. That makes it easier to run full development environments in browsers and on Cloudflare Workers.
How to try it
The experimental release can be installed from npm:
The teams note that frontier AI models can now do large-scale ports in a matter of days, and that several Rust and C++ versions of TypeScript have appeared. tsrs aims to stay faithful to TypeScript's original implementation.