All Articles

TypeScript Announces Go Rewrite, Achieves 10x Speedup

Matt Pocock
Matt PocockMatt is a well-regarded TypeScript expert known for his ability to demystify complex TypeScript concepts.

Today, TypeScript announced a full rewrite of TypeScript in Go. In testing, this rewrite has achieved a 10x speedup in some repositories - and up to 15x in others.

This speedup will affect every part of the TypeScript ecosystem: from running tsc via CLI to the performance of hovers and errors in your IDE. Once released, you'll be able to adopt the new version of TypeScript without changing a single line of code.

Improved performance has been the community's most-requested feature for years. Several attempts have been made to rewrite TypeScript in a faster language, but none have succeeded.

On Friday (9AM PT) I'll be interviewing Anders Hejlsberg, the lead architect of TypeScript, to discuss the rewrite. Join in on YouTube for the live stream.

How will this affect me?

Once released, the Go rewrite will improve the DX for every TypeScript developer. Let's break each element down:

IDE

Your IDE experience will become 10x faster. This means:

  • Loading large TypeScript codebases
  • Hovers
  • Errors
  • Go-to-definition
  • Rename symbol

...and all other TypeScript features will be 10x faster.

This will especially affect large monorepos, where the TypeScript language server can be painfully slow.

This won't just be in VSCode (or VSCode forks like Cursor and Windsurf). Any code editor that uses the TypeScript language server will benefit.

CLI

The TypeScript compiler (tsc) will be 10x faster. This means faster type-checking locally, and faster builds.

It will also be transformative for CI. Transpiling TypeScript files into JavaScript has gotten extraordinarily fast with tools like esbuild (written Go) and swc (written in Rust). But type-checking has remained slow.

Now, the slowest part of your CI will become much faster - speeding up builds everywhere.

Will I have to change my code?

No, your code will stay exactly the same.

When will it be ready?

The release has been promised for TypeScript 7.0. TypeScript doesn't follow semantic versioning - releases simply count up from 1.8, 1.9, 2.0 - and they release a new version every 3 months or so. We're on version 5.8 now - so by the current cadence 7.0 will be around 33 months away.

However, it seems more likely they'll simply release it when it's ready. My hunch would be that a beta will be ready by November 2025.

How can I try it out?

Check out the new typescript-go repo for instructions.

Will development pause on the current TypeScript codebase?

No - new features will continue to be added to the JavaScript version of the codebase as the Go version is being developed.

Some of the TypeScript team will work on the codebase full-time. Some will continue work on the JavaScript version.

Why not Rust?

The TypeScript team posted about their reasoning for choosing Go in a GitHub discussion.

It seemed to be the best choice for several key reasons. Far and away the most important reason was its structural similarity to the current JavaScript implementation. Go's programming patterns closely resemble TypeScript's existing code structure.

Here's a still from the Anders Hejlsberg presentation. TypeScript is on the right, Go on the left.

A still showing a Go and TypeScript codebase looking very similar

This means that contributors familiar with the existing codebase will be able to navigate the codebase easier. This is crucial since both codebases will be maintained simultaneously for some time.

So - nothing against Rust. Go seemed to fit the bill better.

Why not speed up the JavaScript code?

To speed up a TypeScript, you need a language with multi-threading support. JavaScript can only really work on one core at a time. It has some upcoming features (like Shared Structs) which can be shared across threads, but they're not ready yet.

Languages like Go and Rust have multi-threading support built-in, which means they can use multiple CPU cores to parallelize as much work as possible. This is why they're so much faster.

Matt's signature

TypeScript Announces Go Rewrite, Achieves 10x Speedup

TypeScript 5.8 Ships --erasableSyntaxOnly To Disable Enums

TypeScript 5.8's new erasableSyntaxOnly flag enforces pure type annotations by disabling enums, namespaces, and parameter properties.

Matt Pocock
Matt Pocock