Microsoft goes nuclear on TypeScript codebase…
Based on Fireship's video on YouTube. If you like this content, support the original creators by watching, liking and subscribing to their content.
Microsoft is rewriting the TypeScript compiler in Go to overcome performance limits caused by the compiler being written in TypeScript.
Briefing
Microsoft is accelerating the TypeScript compiler by rewriting it in Go, aiming to eliminate a core performance bottleneck: TypeScript’s compiler is written in TypeScript, which limits low-level optimization. The practical result is a major speedup—Microsoft reports cutting VS Code TypeScript compile time from 70 seconds to 7 seconds, with similar ~10x improvements across other projects. For developers, that translates into faster feedback loops in large codebases and less editor lag when working with big TypeScript projects.
The change is also framed as a “port,” not a brand-new implementation from scratch. Microsoft plans to convert the existing TypeScript codebase line-by-line into equivalent Go code, preserving the compiler’s behavior and semantics. That means the same kinds of compiler errors and edge-case behavior should remain—just delivered much faster. The rewrite targets the long-term goal of making TypeScript’s tooling more responsive without changing what developers already rely on.
Why Go? The key technical reasons are performance portability and compilation model. Unlike Java or C-style toolchains that typically compile to bytecode running on a virtual machine, Go compiles directly to optimized machine code for different chip architectures. Go also includes automatic memory management via garbage collection, which can reduce the complexity of manual memory handling compared with C++ or Rust. Microsoft’s choice of Go—rather than sticking with an in-house language or jumping onto Rust or Zig—signals a focus on engineering constraints: the compiler needs to run fast across platforms, and the implementation language must support that efficiently.
The timeline matters. The rewrite is not expected to ship immediately because TypeScript is currently at version 5.8, while Microsoft isn’t planning a release until TypeScript 7. Even then, adoption could take months or longer as the ecosystem transitions.
For developers, the immediate takeaway is that TypeScript performance issues tied to compiler speed should improve substantially, especially in editors like VS Code and in large repositories. The longer-term takeaway is that Microsoft is willing to break with language loyalty—using a language associated with Google rather than a Microsoft-first option—to fix a foundational tooling problem. When the new compiler lands, the same TypeScript experience should feel dramatically snappier, with faster builds and fewer productivity hits from slow typechecking.
Cornell Notes
Microsoft is rewriting the TypeScript compiler in Go to remove a fundamental limitation: the compiler is currently written in TypeScript, which makes low-level optimization harder. Microsoft reports about a 10x speedup, including a VS Code compile-time drop from 70 seconds to 7 seconds. The effort is effectively a port—converting the existing TypeScript compiler code line-by-line into equivalent Go—so compiler behavior and error semantics should remain consistent, just faster. The rollout is expected around TypeScript 7, not immediately from TypeScript 5.8, so ecosystem migration will take time. The choice of Go centers on compiled performance and portability, since Go builds optimized machine code across architectures and uses garbage collection to simplify memory management.
What problem inside TypeScript’s toolchain is driving the rewrite?
What does “rewrite” mean here, and what should developers expect to stay the same?
How big are the performance gains, and where do they show up first?
Why Go specifically—what advantages does it bring compared with other options?
When will this change reach users, and why isn’t it immediate?
Review Questions
- What specific limitation comes from having the TypeScript compiler written in TypeScript, and how does moving to Go address it?
- How does converting the compiler code line-by-line affect the likelihood of breaking changes for developers?
- What combination of compilation model and memory management features makes Go a good fit for a cross-platform compiler rewrite?
Key Points
- 1
Microsoft is rewriting the TypeScript compiler in Go to overcome performance limits caused by the compiler being written in TypeScript.
- 2
Reported speedups are around 10x, including a VS Code compile-time reduction from 70 seconds to 7 seconds.
- 3
The effort is effectively a port: TypeScript compiler logic is converted line-by-line into Go to preserve semantics and error behavior.
- 4
Go was chosen for compiled performance and portability, producing optimized machine code across architectures.
- 5
Go’s garbage collection is expected to simplify memory management compared with languages like C++ or Rust.
- 6
The new compiler is planned for TypeScript 7, not immediately from the current 5.8 baseline, so adoption will take time.