Cloudflare's Rust TypeScript Compiler Cuts Memory 70%, Runs 8x Faster Than Go Version
Cloudflare's VoidZero team develops tsrs, a Rust port of the TypeScript compiler that reduces memory usage by 70% and achieves up to 8x faster type checking than the Go-based version, while adding WebAssembly support for browser-based type checking.
Cloudflare's VoidZero team, in collaboration with engineers from Owner.com, is developing tsrs — a Rust port of the TypeScript compiler. Preliminary benchmarks show that when performing the same type-checking workload as Microsoft's Go-based TypeScript 7.0, tsrs runs up to 8 times faster and uses approximately 70% less memory .
A key technical advantage of Rust is its native WebAssembly (Wasm) support . Unlike Go, which must bundle a garbage collector when compiled to Wasm, Rust avoids that overhead, enabling tsrs to run a full type-checking environment directly in the browser, on embedded devices, or in IoT applications. The project already publishes a Wasm package that can check TypeScript code in the browser and emit JavaScript and declaration files. The browser version currently operates single-threaded and does not yet provide a language service for editors.
Cloudflare emphasizes that tsrs is not a fork and will strictly follow the Microsoft TypeScript team's design decisions to prevent divergence. The team has coordinated with Microsoft to ensure identical benchmark configurations, and some performance improvements from tsrs have already been upstreamed into the Go-based compiler. Remaining differences include the order of error messages, which the team plans to align.
Future work includes merging tsrs with another Rust port, tsc-rs , into a single component that will support language services and other editor integrations. Cloudflare states: "We believe the TypeScript team should retain full control over language design and direction; we do not want to change that." The port must remain faithful because the TypeScript team spent years prototyping certain features — a port that falls behind will inevitably rot.
Other recent TypeScript tooling efforts include Bun 1.4.3 , which added bun check — a type checker ported from the Go version that finds type errors before execution but does not emit JavaScript — and Vercel Labs' tsc-ts , which reimplements the Go compiler in TypeScript and compiles it to native code via their scriptc tool, supporting both type checking and JavaScript output.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
21CTO
21CTO (21CTO.com) offers developers community, training, and services, making it your go‑to learning and service platform.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
