Blogs / A Port, Not a Rewrite: How TypeScript Moved to Go

A Port, Not a Rewrite: How TypeScript Moved to Go

How the TypeScript 7.0 RC announcement says the compiler was ported to Go, why it says the semantics are unchanged and which steps run in parallel.

  • Learning
  • 1 min read

For: Learners curious about compilers.

A port, not a rewrite

Over the past year, we have been porting the existing TypeScript codebase from TypeScript (as a bootstrapped codebase that compiles to JavaScript) over to Go.[1]

The new Go codebase was methodically ported from our existing implementation rather than rewritten from scratch, and its type-checking logic is structurally identical to TypeScript 6.0.[1]

Why the semantics stay the same

This architectural parity ensures the compiler continues to enforce the exact same semantics you already rely on.[2]

Existing TypeScriptcodebaseGo codebaseported methodically, notrewritten from scratchSame semanticstype-checking logicstructurally identicalported toenforces
What does the announcement say stays the same when the codebase moves to Go?

Which steps run in parallel

TypeScript 7.0 now performs many steps in parallel, including parsing, type-checking, and emitting.[1]

Some of these steps, like parsing and emitting can mostly be done independently across files.[1]

Other steps, like type-checking, have more complex dependencies across files.[1]

Sources

  1. Announcing TypeScript 7.0 RC (devblogs.microsoft.com · checked )
  2. Announcing TypeScript 7.0 RC (devblogs.microsoft.com · checked )

More articles