Thursday, March 13, 2025

TypeScript just got 10x faster… (because of Go)

Programming LanguageTypeScript just got 10x faster… (because of Go)


TypeScript just got 10 times faster, cause Microsoft rewrote the ENTIRE compiler in Go.

The JavaScript ecosystem is massive, but the average React project has over 1,500 dependencies, and TypeScript has to process ALL of them. Therefore, the original TypeScript compiler, written in… well, TypeScript, has been struggling to keep up.

So, Build times take MINUTES, with you staring at your terminal, contemplating whether you should’ve just used any everywhere and called it a day.

Luckily Microsoft has been secretly cooking up a solution which is “TypeScript-Go” – a native port of the TypeScript compiler written in Go.

Why Go? Not because it’s trendy, but because it’s a compiled language with fast startup times, solid concurrency, and excellent memory management. Plus, it can compile to native binaries across multiple platforms without throwing a never-ending list of errors. pun intended…

And the numbers don’t lie: That’s a 10X SPEEDUP in real-world scenarios! The compiler is now so fast that for small projects, it feels almost instantaneous.

So your types are now checking out faster than developers at 4:59 PM on a Friday.

To make it that fast, first, Microsoft created a transpiler that converted TypeScript to Go code automatically. But don’t get too excited – this was just to bootstrap the process. The real magic happened when they:

  1. Rewrote critical path components by hand
  2. Optimized memory allocations
  3. Parallelized type-checking operations
  4. Eliminated JSON serialization overhead, and
  5. Implemented fast, native file system calls

The result? A compiler that starts faster, runs faster and uses less memory.

But speed isn’t just about convenience. When compilation gets this fast, it fundamentally changes how developers work, so you get:

  • Near-instant feedback in your IDE
  • CI/CD pipelines that don’t make you wait until next Tuesday, and
  • Viable type checking in serverless environments with cold starts

And the biggest win: developers stop disabling TypeScript in development to save time, leading to fewer production bugs. No more any escape hatches because you’re too impatient for the type checker.

Yet, the Go port is still experimental, and there are some edge cases around custom transformers and plugin architectures. On top of that, Microsoft will need to maintain TWO codebases now, which is never ideal.

And for the purists out there – isn’t it ironic that TypeScript, which was supposed to “fix” JavaScript, couldn’t even compile itself efficiently? That’s what happens when you try to interface with JavaScript’s chaos.

If you want to get started right now, run this in your terminal or use the binary directly: It’s a drop-in replacement for the regular TypeScript compiler, so just swap tsc with tscgo and you’re good to go.

Commands

This isn’t just about TypeScript. It signals a broader trend: the JavaScript ecosystem is hitting performance limits, and compiled languages are coming to the rescue. We’re seeing Rust, Go, and Zig increasingly replacing JavaScript in critical infrastructure.

In a nuthsell, JavaScript created the web as we know it, but its ecosystem is evolving beyond…

Check out our other content

Check out other tags:

Most Popular Articles