Cloudflare and Void Zero are working with Max Schwenk of Owner.com on tsrs, a Rust port of the TypeScript compiler. The project is being built in close collaboration with the TypeScript team and incubated as part of the Oxc JavaScript compiler toolchain. The stated goal is to help developers spend less time waiting for their code to be checked and more time building, and to bring faster, more memory-efficient TypeScript to more environments, including the browser.
The team stresses that tsrs is not a fork. The TypeScript team will remain in full control of the language's design and direction. A Rust port has to follow the TypeScript team's decisions closely, since features are often prototyped for years before an implementation is chosen, or the port risks becoming incompatible.
Early benchmarks show tsrs running up to 8x faster and using ~70% less memory than TypeScript 7.0 with the same number of type check workers. The next TypeScript release, 7.1 beta, is up to 2.5x faster than 7.0, and some of those optimizations were upstreamed from tsrs. By default, tsrs uses an adaptive configuration that consumes more memory for even greater speed. An experimental release can be installed from npm.
TypeScript's Go port already delivered large gains, but the team argues Rust offers additional advantages. Rust's memory model allows simpler interaction between a WebAssembly guest and host, whereas compiling Go to Wasm requires bundling its garbage collector. Because Cloudflare Workers run build and deployment systems in tight loops, a small memory footprint matters a great deal.
Source: Hacker News · Summarized by HeadlinesBriefing