HackerTube

TypeScript is being ported to Go | interview with Anders Hejlsberg

Michigan TypeScript2 HN recommenders · recommended in 1 month, 2025–2025
YouTube
interview · intermediate · 2025–2025 on HN

An interview with Anders Hejlsberg, lead architect of TypeScript, about porting the TypeScript compiler to Go. He covers the 10x type-checking speedup, lower memory use, and why Go was chosen.

HN points to it as the authoritative answer to why the team picked Go rather than C# or Rust, citing timestamps on cyclic data structures and garbage collection.

9 comments from Hacker News

@duckerude2025-03 · in “A 10x Faster TypeScript”

Anders Hejlsberg explains here: ▶ this video . TL;DW: - C# is bytecode-first, Go targets native code. While C# does have AOT capabilities nowadays this is not as mature as Go's and not all platforms support it. Go also has somewhat better control over data layout. They wanted to get as low-level as possible while still having garbage collection. - This is meant to be something of a 1:1 port rather than a rewrite, and the old code uses plain functions and data structures without an OOP style. This suits Go well while a C# port would have required more restructuring.

Recommends View on HN
@yohannesk2025-03 · in “A 10x Faster TypeScript”

If you are wondering why not Rust instead of Go, they outline why Rust was not chosen. This is a port not a reimplementation. Many of the data structures can not easily be ported to Rust, such as Nodes with cyclic dependencies. Check the longer interview here: ▶ this video Also, I think the discussion on esbuild's choice of language applies here as well as it has a large similarity. You can find it here on hn

Recommends View on HN
@jtbaker2025-08 · in “Rv, a new kind of Ruby management tool”

▶ this video Around the 13 minute mark, Anders goes into it. IIRC, the big things were the GC and them both supporting cyclic data structures.

@osigurdson2025-06 · in “Why Go Rocks for Building a Lua Interpreter”

Yeah. They said that there were lots of nested structures with cycles and so on so it would be hard to do with Rust. Link below. ▶ this video

@emn132025-05 · in “Past, present, and future of Sorbet type syntax”

While I'm most familiar with C#, and haven't used Ruby professionally for almost a decade now, I think we'd be better off looking at typescript, for at least 3 reasons, probably more. 1. Flowsensitivity: It's a sure thing that in a dynamic language people use coding conventions that fit naturally to the runtime-checked nature of those types. That makes flow-sensitive typing really important. 2. Duck typing: dynamic languages and certainly ruby codebases I knew often use ducktyping. That works really well in something like typescript, including really simple features such as type-intersections and unions, but those features aren't present in C#. 3. Proof by survival: typescript is empirically a huge success. They're doing something right when it comes to retrospectively bolting on static types in a dynamic language. Almost certainly there are more things than I can think of off the top of my head. Even though I prefer C# to typescript or ruby _personally_ for most tasks, I don't think it's perfect, nor is it likely a good crib-sheet for historically dynamic languages looking to add a bit of static typing - at least, IMHO. Bit of a tangent, but there was a talk by anders hejlsberg as to why they're porting the TS compiler to Go (and implicitly not C#) - ▶ this video - I think it's worth recognizing the kind of stuff that goes into these choices that's inevitably not obvious at first glance. It's not about the "best" lanugage in a vacuum, it's a about the best tool for _your_ job and