TypeScript 7: Compiler Rewrite in Go

Better Stackgo watch the original →

TypeScript 7 introduces a Go-based compiler that achieves up to 10x faster type checking by leveraging shared memory parallelism, while maintaining full compatibility with existing TypeScript 6 logic.

Performance Gains via Go Rewrite

TypeScript 7 replaces the legacy JavaScript-based compiler with a Go implementation. This shift moves the type-checking process from a single-threaded environment to one capable of shared memory parallelism. In benchmarks using the Playwright repository, the new compiler reduced type-checking time from 6 seconds to 0.87 seconds while identifying the exact same set of errors.

Parallelism and Configuration

The new compiler exposes granular control over resource utilization through two primary flags:

  • --checkers: Controls the number of parallel type-checker workers. The default is 4, but increasing this value can further reduce build times on high-core-count machines at the expense of higher memory usage.
  • --builders: Manages the number of parallel project reference builds. When combined with the --checkers flag, developers can scale concurrent operations significantly, such as running 16 total checkers simultaneously.

For debugging or resource-constrained environments, a single-threaded mode is available, which still performs roughly 3x faster than the TypeScript 6 compiler.

Watch Mode and Language Changes

The watch mode was entirely rewritten in Go to ensure stability and cross-platform performance, utilizing a ported version of the file-watcher originally developed for the Parcel bundler. While the compiler rewrite is a major architectural shift, it introduces no breaking changes for users upgrading from TypeScript 6. The only notable language-level change is that template literal types now split on whole Unicode code points rather than UTF-16 code units, ensuring that multi-byte characters like emojis are preserved during string manipulation.

  • #dev-tooling
  • #typescript

summary by google/gemini-3.1-flash-lite. probably wrong about something. check the source.