CLOUDFLARE and VoidZero are working with Max Schwenk of Owner.com on tsrs, an experimental Rust port of the TypeScript compiler, in collaboration with the TypeScript team. The project is being developed within the Oxc JavaScript toolchain. Cloudflare says tsrs is not a fork: the TypeScript team will retain control of the language’s design, and the port aims to follow the original implementation closely to avoid incompatible behaviour.
Early benchmarks published by the project indicate that tsrs is up to 8x faster and uses about 70% less memory than TypeScript 7.0 when both use the same number of type-checking workers. Cloudflare says TypeScript 7.1 beta is already up to 2.5x faster than 7.0, with some optimisations contributed by tsrs. The company says the comparisons use the same configuration, while tsrs’s default adaptive settings can use more memory in exchange for greater speed. These are early results, and the article notes that tsrs still differs from TypeScript in some respects, including the order in which diagnostics appear.
An experimental package is available through npm. The project is also intended to support WebAssembly, which Cloudflare says could make it practical to run development tools in browsers and other constrained environments. The teams plan to keep the port aligned with upstream TypeScript, test compatibility and contribute performance improvements back to TypeScript.