Porting TypeScript to Go: A 10x Speed Boost

TypeScript Goes Native
Microsoft just made a bold move: they’re porting the TypeScript compiler to Go. The result? A massive performance boost, with compilation speeds up to 10x faster. This isn’t a full rewrite but a direct port, meaning TypeScript will behave exactly the same—just much, much faster.

Benchmark results showing TypeScript compilation times: JavaScript vs Go implementation across different project sizes
Why Move Away from JavaScript?
TypeScript has always been written in TypeScript, but that choice comes with limitations. The biggest issue? TypeScript extends JavaScript with static typing and enhanced tooling, but JavaScript itself isn’t optimized for the high-performance demands of a compiler. Moving to Go fixes that by:
- Eliminating JIT overhead – No more Just-In-Time compilation slowing things down.
- Leveraging shared memory concurrency – Go lets TypeScript run tasks in parallel across multiple CPU cores.
- More efficient data structures – Go enables direct memory access and better data layout.
The numbers are eye-opening. Compiling VS Code (~1.6M lines of TypeScript) used to take 70 seconds. Now? 7 seconds. The same 10x speedup applies across other large projects.
Why Go Instead of Rust or C++?
When news broke that Microsoft had chosen Go — a language created by their long-time competitor Google — it sparked some reactions. So why did they choose Go instead of Rust, C++, or even one of their own in-house languages? A few key reasons:
- Garbage Collection (GC) – TypeScript already relies on automatic memory management, and Go provides that seamlessly.
- Portability – The goal wasn’t to rebuild TypeScript from scratch but to port it line by line, preserving behavior exactly. Go made this process significantly easier.
- Simplicity – Go is straightforward, with a concurrency model that’s easier to manage than Rust’s borrow checker or C++’s manual memory management.
What This Means for Developers
- Faster builds – CI/CD pipelines are about to get a serious speed boost.
- Snappier editor performance – VS Code and other TypeScript-powered editors will feel noticeably faster.
- Same TypeScript, just faster – Your existing TypeScript projects will behave the same, but compiler errors will appear much more quickly.
What’s Next?
The Go-based compiler won’t be available immediately. Right now, we’re at TypeScript 5.8, and Microsoft plans to release the new compiler as part of TypeScript 7. That means it could be months or even years before we see this fully rolled out.
Still, this is a major step forward for TypeScript and modern web development. Faster builds, better performance, and a more efficient compiler? Sounds like a win all around.
Sprouts 🌱 are early ideas that might need revision and attention.
Saplings 🌿 are a step above—not fully developed but more fleshed out than sprouts.
Evergreens 🌲 are complete and likely won't be updated anymore.
Read more about my digital garden.