typescript

They ported tsc to Go

They ported tsc to Go

In March, Anders Hejlsberg announced that the TypeScript compiler and tooling are being ported to Go, under the codename Corsa. The number attached was that the VS Code codebase, about 1.5 million lines, goes from roughly 78 seconds to type-check with tsc down to about 7.5 seconds. A factor of ten.

Six months on, the previews exist and the thing is real. I've been using TypeScript daily for years and waiting on tsc for most of them, so I wanted to write a note about it. What I keep thinking about, though, is the language argument.

Why not C#

Hejlsberg created both TypeScript and C#, and Microsoft owns C#, so the obvious question got asked loudly and repeatedly.

The stated reason is that this is a port, not a rewrite. The existing compiler is a large body of TypeScript written in a particular style: functions over data structures, closures, structural typing, heavy use of shared mutable state through a checker that is not object-oriented, by choice. A port keeps the structure and translates it, and that's how you preserve behaviour, including the edge cases that aren't written down anywhere. In a compiler with this much history those are most of the behaviour that matters.

Go maps onto that style closely. Functions and structs, no class hierarchy imposed on you, a garbage collector so ownership doesn't have to be redesigned, native compilation, and good concurrency for parallelising work across files. C# would have pushed the code towards a different structure, and changing the structure would have changed behaviour somewhere.

I think that reasoning is sound, and I would apply it generally. When the requirement is "identical behaviour, much faster", the language you want is the one whose idioms are closest to the code you already have, and that may not be the one you like most.

It was also striking to watch from outside. The most successful language project at Microsoft chose Go for its own compiler on technical grounds, in public, and explained why. Most organisations don't manage to make that decision in such a healthy way.

Where the speedup comes from

Two places, and the split matters for what to expect.

Native compilation removes the JavaScript engine's warm-up and gives better memory behaviour on the enormous graphs a type-checker builds. That's most of the baseline win and it applies to every project.

Concurrency is the rest. Type-checking has independent work in it (files that can be checked in paralell) and a single-threaded JavaScript process was never going to take it. How much that helps depends on what your codebase looks like, so a figure from one large project is a starting point and not a prediction.

So I'd expect the improvement on a small service to be real and unremarkable, and on a large monorepo to be the difference between running tsc in a watch loop and avoiding it. The projects that were suffering most will benefit most.

The editor, more than the build

Editor responsiveness more than build time, I suspect. The language service is the same engine, and in a big project the lag between typing and the editor understanding what you typed costs a lot more than a CI step that runs while you do something else.

It also puts a dent in an argument I have made myself. Every conversation about TypeScript build performance for the last few years has ended with someone suggesting a faster tool that strips types instead of checking them - esbuild, swc, and now Node stripping types directly. Those are fast because they do less. They don't type-check. If the tool that does check becomes ten times faster, the "skip checking in development" compromise gets harder to justify.

What I am not doing yet

Putting it in a pipeline. It's a port of a compiler with a decade of accumulated behaviour, the promise is that the behaviour is identical, and that promise only gets tested by large codebases running both and comparing.

The cheap and useful version is to run it alongside on a project I already have, compare the diagnostics with what the current compiler produces, and report anything that differs. That costs an afternoon and it contributes to what makes the port trustworthy. It also tells me what the number looks like on my own code and not on VS Code's.

Deyan Peev

Founding Engineer in Sofia, Bulgaria. Currently at 1club.

© 2026 Deyan Peev