Artificial Intelligence

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.

StartupHub.ai Staff

By StartupHub.ai Staff, reviewed by Daniel Singer, Editor

3 min read

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
Inside the 10x Faster TypeScript Rewrite

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.

Sources

TopicsAnders HejlsbergTypeScriptGoRustMicrosoftV8Visual Studio Code

StartupHub.ai StaffDaniel SingerWritten by StartupHub.ai Staff, Editorial teamReviewed by Daniel Singer, EditorAbout

StartupHub.ai Staff, Editorial team

The staff writers of StartupHub.ai, ranging from investment analysts to avid AI tool users, early adopters and critical enthusiasts. Backgrounds span engineering, business and the arts. We hold every piece to rigorous standards of research and review.

Daniel Singer, Editor

Daniel Singer is an AI expert who has been writing about, covering and building AI technology since 2018.

More from Daniel Singer

Get the free daily brief every morning

Every morning the day's AI news, new AI startups and new funding rounds. Free and takes a few minutes to read, unsubscribe at any time.

Join 64,000 other subscribers.

Test your Agent Readiness now

Paste your website. How well ChatGPT, Claude and the other agents can read and use a site, in about a minute.

The videos behind the news, one flip at a time

The feed mixes the videos from our articles with startup demos and you flip through them like TV channels for free with no signup.