Tsrs: A Port of TypeScript to Rust

424 points · 206 comments on HN · read original →

Points and comments are a snapshot, not live.

Cloudflare ported TypeScript's Go compiler to Rust, achieving 3-4x speedups and enabling WASM-only sandbox execution.

Cloudflare announces tsrs, a Rust port of TypeScript's Go-based compiler (typescript-go). The port compiles VS Code in 1.73s versus 5.28s for TypeScript 7.1 nightly (3x faster) and uses up to 70% less memory. The project was generated almost entirely by AI models with zero hand-written code. The primary motivation was running the TypeScript compiler in Cloudflare's WASM-only sandbox without the full Go runtime. Cloudflare is working with Theo to absorb the tsgo-rs project into tsrs.

What commenters are saying

Commenters are split between excitement over the performance gains and unease about the AI-generated, zero-human-code approach. A TypeScript team member confirms they are studying tsrs's optimizations for future TS 7.1 improvements. Several note the primary use case is AI agent sandboxing on Cloudflare, not everyday local development. Some question whether 8x speedup claims hold up (measured at ~3-4x for VS Code). Others argue the real takeaway is that JavaScript tooling should have been written in Rust from the start, not ported later.