Inside the 10x Faster TypeScript Rewrite

Anders Hejlsberg says TypeScript 7 ports the compiler from JavaScript to Go for 10x speed, solving concurrency and scale limits in large codebases.

3 min read
Anders Hejlsberg discusses TypeScript 7 native rewrite to Go for faster compilation
TypeScript 7 moves the compiler from JavaScript to Go to unlock native speed and shared memory concurrency.· YouTube
Contents(3)

Anders Hejlsberg, the creator of TypeScript and C#, said the TypeScript 7 native rewrite finally delivers the promised 10x faster TypeScript. The team ported the half-million-line compiler from JavaScript to Go.

Inside the 10x Faster TypeScript Rewrite - YouTube
Inside the 10x Faster TypeScript Rewrite, from YouTube

He laid out the reasoning in a new YouTube interview. The short version: scale.

Visual Studio Code now sits at 2.3 million lines, and Microsoft has internal TypeScript projects over 10 million lines. That was unthinkable when TypeScript began in 2012 as the Strata project, first in C, then in JavaScript so the team could self-host.

Self-hosting paid off. The team dogfooded the language every day, and the compiler ran everywhere, even in the browser, at a moment when V8 had pulled JavaScript to within two to three times native speed.

The trade has flipped since then. TypeScript 6 runs at roughly half the speed of TypeScript 1.5, because each addition like union types and control flow analysis carries a checking cost.

Moore's law now hands out cores instead of clock speed. JavaScript cannot share memory between workers without serializing it, so multi-core performance stays out of reach.

Why this matters for AI and startups

Agents hammer the compiler through LSP and command-line checks on every generation. When type checking drags on for minutes, agent loops stall and iteration costs climb.

TypeScript also holds the incumbency card. Hejlsberg pointed out that it passed both JavaScript and Python to become the most-used language on GitHub, with more than half of JavaScript now written as TypeScript. Almost every code generator he sees outputs TypeScript, because types help LLMs self-correct without running the code.

Why Go won over Rust for the port

Hejlsberg said the team chose a port over a full rewrite to keep error messages and semantics identical for backwards compatibility. That required garbage collection and first-class closures, and Go offers both, along with mature native code generation and shared-memory concurrency on every major platform.

Rust would have forced manual workarounds for circular data structures. The compiler is full of parent pointers, recursive types, and symbols that refer to each other, and Hejlsberg noted the borrow checker does not allow that shape without unsafe or ref-counting tricks. There was no codegen or concurrency advantage to justify the extra work.

What the 10x speed story leaves out

The interview skips over how the 10x is measured and what developers actually feel on incremental edits, not just cold builds. Hejlsberg said early scanner and parser prototypes proved the gain, and the team built a syntactic translator from TypeScript to Go to bootstrap the rest, but there is still no detail on distribution, browser fallback, or whether WebAssembly will continue to ship the editor path.

For startups that live in editors, that distinction is the gap between a faster CI and a faster daily loop.

LLMs barely helped with the port itself. The project started two years ago, before models were good enough, and Hejlsberg said the better pattern is to have AI write the deterministic translator, not the translated code. Stochastic output on a million lines cannot be trusted without a line-by-line audit.

He is blunt that AI will not write his compiler anytime soon. It has memorized the internet but has seen almost none of this codebase, so it cannot invent the algorithms at the core.

Incumbent languages will get stronger, not weaker, because they dominate the training data.

© 2026 StartupHub.ai. All rights reserved. You may not republish this article in full without a license. Search engines and AI research tools may crawl and summarize for reference. Bulk reproduction or model training requires a license. See our terms.