Tsrs: A Port of TypeScript to Rust
Cloudflare’s new Rust-based TypeScript compiler, tsrs, claims up to 3–4x faster compile times on large projects and about 70% lower memory use than the official implementation, driven partly by a custom arena-style memory model and better fit for WebAssembly. Commenters weigh the practical benefits—cheaper, faster tooling for massive CI and AI agent workflows—against concerns about unsound unsafe Rust patterns and the broader trend of AI-generated “vibe coded” ports undercutting human-crafted compilers. Many see this as both a validation of Rust and WASM for high-performance developer tooling and a signal that language tooling ecosystems may soon maintain multiple AI-assisted implementations in parallel.
Performance and Benchmarks
- Claims of up to ~8x speed and ~70% lower memory than the TS 7.0 baseline; concrete example: VS Code compiles ~3–4x faster in tsrs than in TS 7/7.1.
- Some argue TS/TSGO is already “fast enough” for many projects, others report large real-world wins (e.g., 10s → <0.5s type-check, big memory drops) and note cumulative savings for large monorepos and high-volume CI/agent workloads.
Motivation: WASM, Workers, and Agents
- Core driver is running the toolchain inside Cloudflare’s WASM-only sandbox without shipping a full Go runtime.
- Rust maps better to WASM (no GC runtime, smaller binaries), which matters at scale and for many concurrent AI agents/worktrees.
Rust vs Go vs Other Implementations
- Go was originally chosen for ease of porting from a GC’d codebase; with AI-assisted ports, that rationale weakens.
- Some argue the “ideal” split is: TypeScript for the reference implementation; Rust for performance/WASM; Go is now a compromise.
- Others stress that language choice still matters for long-term human maintenance and ergonomics.
AI-Generated Port and Developer Workflow
- Port was largely AI-driven with a massive TS test suite as safety net.
- Reactions split: excitement about rapid ports vs anxiety about losing the value of careful, human-designed architecture and code review.
- Some claim reviewing AI code will soon be a waste; others call that naïve and emphasize ongoing human oversight.
TypeScript Team and Ecosystem Impact
- TS team is collaborating with tsrs, borrowing optimizations into TS 7.1 (lazy work, better allocation/layouts), and seeing that speedups are not just “Rust vs Go” but algorithmic.
- Debate over continuing to invest in TSGO when Rust enables WASM and better efficiency; counters highlight stability, compatibility, and team preference.
Memory Model and Safety Concerns
- tsrs uses arena-style allocation and a custom “fake GC”/recycling scheme.
- Some praise the approach; others criticize unsound
'staticabstractions and sanitizer-based validation as “back to C,” worrying it undermines Rust’s safety guarantees.
Meta: Rust Rewrites, Open Source, and AI Fatigue
- Mixed feelings about the broader “rewrite everything in Rust” and “vibe-coded” AI ports trend.
- Concerns that AI-driven, faster forks of mature projects may discourage open-source authors who feel their work can be cheaply superseded.