TypeScript Got Ported To Rust... And It's 3x Faster Than Go

5:201 min readBetter Stack11/05/2026Computing/Software

Key Takeaway

A new Rust-based TypeScript compiler, developed in just three weeks using AI agents, delivers type-checking speeds roughly 24 times faster than the original JavaScript compiler.

Highlights

  • A fully compatible TypeScript compiler written in Rust achieves nearly three times faster performance than the Go version.

Timeline

  1. Introduction to the Rust TypeScript Compiler

    Following Microsoft's previous port of the TypeScript compiler to Go, a new Rust implementation emerged. Initial headlines indicate performance speeds between two and eight times faster than existing alternatives.

    • A fully compatible TypeScript compiler written in Rust is now available.
  2. Compilation Steps and Performance Benchmarks

    Testing against the TypeScript repository containing 793 files and 380,000 lines of code demonstrates substantial speed gains across multiple scenarios. On average, the Go compiler operates 9 to 10 times faster than JavaScript, while the Rust compiler reaches 24 times faster than JavaScript and nearly three times faster than Go.

    • Type checking consumes significant time on large codebases compared to stripping types during the build step.
  3. AI-Assisted Development Process

    An engineer directed a team of AI agents led by Claude Opus 5.5 to copy Microsoft's Go compiler into Rust function by function. Utilizing a massive test suite containing over 13,000 small programs allowed agents to port functions, run tests, and fix errors systematically.

    • The Rust compiler development required only three weeks from its first commit to announcement.
  4. WebAssembly Integration and Future Usage

    Rust operates without a garbage collector, avoiding the extra baggage that Go carries when compiled into WebAssembly. This capability allows developer tools to run directly inside browser environments and custom sandboxes.

    • Cloudflare and the Vite team are developing the Rust compiler in collaboration with the TypeScript team.

Description

A fully compatible TypeScript compiler written in Rust just landed, and it's meant to be almost 3x faster than the Go port. We ran tsrs, the Go compiler and JavaScript tsc side by side on the TypeScript repo, and found out how it was built in three weeks. If slow type checks eat your day, watch this. 🔗 Relevant Links https://blog.cloudflare.com/typescript-rust-port https://github.com/oxc-project ❤️ More about us Radically better observability stack: https://betterstack.com/ Written tutorials: https://betterstack.com/community/ Example projects: https://github.com/BetterStackHQ 📱 Socials Twitter: https://twitter.com/betterstackhq Instagram: https://www.instagram.com/betterstackhq/ TikTok: https://www.tiktok.com/@betterstack LinkedIn: https://www.linkedin.com/company/betterstack 📌 Chapters: 0:00 Intro 0:40 What a TypeScript compiler actually does 1:32 JavaScript vs Go vs Rust: the benchmark 2:53 How it was built in three weeks 4:06 Why build it in Rust 4:45 What's next for tsrs

Write about this video