MikhbarMIKHBAR
Automation

Cloudflare Collaborates on tsrs, a Rust Port of TypeScript

Cloudflare and collaborators have introduced tsrs, an ambitious open-source Rust port of TypeScript designed to deliver dramatic performance gains while maintaining complete language compatibility.

Cloudflare Collaborates on tsrs, a Rust Port of TypeScript

Introduction to tsrs

Cloudflare and VoidZero are working alongside Max Schwenk of Owner.com on tsrs, an initiative to build a Rust port of the TypeScript compiler. The project is being developed in close collaboration with the official TypeScript team and is currently being incubated as part of the Oxc JavaScript compiler toolchain. According to the announcement on the Cloudflare Blog, the primary goal of the collaboration is to help developers spend less time waiting for code type-checking and more time building applications.

The creators emphasize that they are not forking TypeScript. They believe that the official TypeScript team should maintain full control over the language's design, direction, and long-term vision. Because the Rust port must closely mirror upstream decisions to remain compatible, the TypeScript team remains solely responsible for determining how the language evolves.

Introducing tsrs: a Port of TypeScript to Rust
Image related to the report from Cloudflare Blog · Source: Cloudflare Blog

Performance Benchmarks and Configuration

Early performance metrics for the new port are promising. When utilizing an equivalent number of type check workers, tsrs delivers execution speeds up to 8x faster while consuming approximately 70% less memory compared to TypeScript 7.0. Organizers worked directly with the TypeScript team to ensure that the above benchmarks accurately compare identical configurations without inflating machine types or altering default parameters.

While the next version of TypeScript already brings significant internal speed enhancements—such as TypeScript 7.1 beta being up to 2.5x faster than version 7.0—several of those optimizations were upstreamed directly from the tsrs development process. By default, the package ships with an adaptive configuration that scales with the host machine type to maximize speed.

Developers interested in experimenting with the software can install an experimental release directly via npm. Those tracking the project can also review ongoing updates through the package registry.

Cloudflare Collaborates on tsrs, a Rust Port of TypeScript
Image related to the report from Cloudflare Blog · Source: Cloudflare Blog

Advantages of Rust and WebAssembly

Although previous efforts successfully ported TypeScript from JavaScript to Go, the Rust language offers distinct technical advantages, particularly regarding WebAssembly integration. Unlike Go programs—which require bundling a garbage collector into the final WebAssembly output—Rust features a memory management model that allows straightforward memory interaction between WebAssembly guests and hosts.

This architectural efficiency makes Rust a natural fit for running workloads inside WebAssembly. Cloudflare Workers have supported WebAssembly for an extended period, and recent platform updates include supporting native Rust in Workers via the Emscripten target for wasm-bindgen. These capabilities allow entire build and deployment systems to execute efficiently in tight loops.

By shrinking the memory footprint and improving execution speed, developers can now run fully encapsulated development toolchains in environments previously unsuited for such workloads. This includes running safe client-side environments directly within web browsers, embedded devices, or IoT applications.

Cloudflare Collaborates on tsrs, a Rust Port of TypeScript
Image related to the report from Cloudflare Blog · Source: Cloudflare Blog

Roadmap and Ecosystem Integration

To consolidate community efforts, the project maintainers are collaborating with Theo Browne to merge tsc-rs and tsrs into a single, unified package. This combined tool aims to support all core TypeScript features, including the Language Server Protocol and content mappers.

Maintainers intend to follow a synchronization strategy similar to Vinext, ensuring the tool stays closely aligned with upstream updates without introducing diverging behaviors. The methodology behind maintaining project alignment with upstream releases has been detailed previously in connection with Next.js integration.

Cloudflare currently hosts various open-source Rust utilities that support the broader JavaScript ecosystem, including Vite, Rolldown, Oxlint, and Oxfmt. The team plans to experiment with deeper tool integration, such as powering type-aware lint rules inside Oxlint using the new compiler port.

Sources

Continue chronologically

Related entity coverage