English
jason's blogObservations on web standards, browsers, and frontend development

Category: TypeScript

TypeScript 7 moves to a native compiler

What the TypeScript compiler was written in, why it needed a native port, and why Go suited the existing codebase.

Published 07/08/2026
On this page

TypeScript 7 introduces a native compiler written in Go. The interesting question is why the tools behind type checking and editor suggestions needed a different implementation language.

What was it written in before?#

The old compiler was written in TypeScript itself, compiled to JavaScript, and typically run through Node.js. Our .ts files were checked and transformed by another program written in TypeScript.

The Go implementation compiles into a program that runs directly on the operating system. That is what “native” means here. Our applications still use TypeScript and produce JavaScript; they do not become Go programs.

Why change it?#

Large projects involve more than checking one file. Changing a shared User type may require revisiting many functions, components, and packages that use it. More relationships mean more work when loading projects, checking types, and updating suggestions.

After years of optimizing the JavaScript implementation, a larger performance leap called for better control over memory layout and an architecture that could use multiple CPU cores more effectively.

The Go version can distribute some work across cores and control data layout more directly. These design choices work together; changing a filename to .go does not automatically make a tool faster. The benefit is faster checks and editor responses, rather than an automatic speedup for the website running in a visitor's browser.

Why Go?#

The team needed to preserve years of type-checking logic so existing code would receive consistent results. Moving that logic reliably mattered alongside speed.

Go suited the port for three reasons:

  • Similar structure: Its coding patterns fit the original compiler's use of functions and data structures, making the implementations easier to compare.
  • Automatic memory management: Garbage collection reclaims unused data while Go gives the team more control over how data is stored.
  • Practical parallelism: Go's concurrency tools help distribute suitable work across CPU cores.

Rust and C# can also power compilers. Go offered a useful balance of performance and migration effort for this particular codebase, helping the team improve speed while preserving behavior.

Sources and further reading