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.
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]
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
- Announcing TypeScript 7.0 RC (devblogs.microsoft.com · checked )
- Announcing TypeScript 7.0 RC (devblogs.microsoft.com · checked )
More articles
- LearningWhat Go 1 Defines and What Stable MeansThe two things the Go 1 document says Go 1 defines, and what it says a stable platform and a point release mean.
- LearningWhat an Import Attribute Is and Why Runtimes DifferWhat an import attribute is, what the json example tells a runtime and why runtimes can differ, as the TypeScript 7.1 Beta announcement describes them.
- LearningWhat SIMD Stands For and Why Go Needed Assembly BeforeWhat the Go team's post says SIMD stands for, how its instructions operate on wide registers and what Go programmers had to do before.