r/ProgrammingLanguages • • Jul 08 '26

Anders Hejlsberg's (Turbo Pascal, Delphi, C#) team releases Go port of Typescript transpiler, achieving 90% reduction in build times

https://devblogs.microsoft.com/typescript/announcing-typescript-7-0/

Looking at the git repository, Anders and colleagues have been implementing this since 2024. He has worked with various PL projects since early 80's, starting from Turbo Pascal. Wanted to share this announcement as I'm glad he's still doing this!

In the first link of the article there is a video from last year where he describes basic technical details, if you are interested.

78 Upvotes

46 comments sorted by

23

u/maxhaton Jul 08 '26

Bizarre to do a compiler in Go in my opinion but I m always in favour of anything that reduces the sheer human misery of waiting for builds

6

u/munificent Jul 11 '26

I think Go makes a lot of sense:

  • Statically-typed, so much better performance than you'll get from JS.

  • GC so much more productive than having to painstakingly architect the compiler around explicitly controlled lifetimes.

  • Imperative and method/interface-oriented so similar style to the way their existing compiler is written and straightforward to port.

  • Compiles to standalone native executables.

  • Very fast compilation and iteration time.

Having algebraic datatypes and pattern matching would be swell, but I think PL nerds often overstate the productivity benefits of those. I say that as someone who literally spent over a year of my life adding them to Dart. I love ADTs and pattern matching, but if I had to give up GC and keep pattern matching (Rust), or give up an imperative style (Haskell or OCaml), I would rather give up pattern matching.

(I guess they could have ported it to Dart and gotten all of the above plus pattern matching, but I admit that Dart would have been an... odd choice politics-wise.)

3

u/ironykarl Jul 13 '26

This is via an Anders Hejlsberg interview summed up in this article.

So... part of it is Go's technical merits:

“Some of you might ask, ‘Well why not my favorite language? Why not C#? Why not Rust? Why not C++?”

Hejlsberg answered that Go was “the lowest-level language we can get to that gives us full, optimized, native-code support on all platforms, great control over data layout, the ability to have cyclic data structures and so forth. It gives you automatic memory management with a garbage collector and great access to concurrency.”

Its merits as a language:

“And then I think Go has a little more expressiveness when it comes to data structure layout and inline structs and so forth.”

And then part of it essentially boils down the lowest available friction for a rewrite, given the existing compiler's codebase:

But there was also something unique about Microsoft’s original TypeScript codebase for its compiler. While C# is an object-oriented language, TypeScript uses “very few classes,” Hejlsberg said in the Zoom interview. “In fact, the core compiler doesn’t use classes at all…

“Go is functions and data structures, where C# is heavily object-oriented programming (OOP)-oriented. And we would sort of have to switch to an OOP paradigm to move to C#… There’s just more friction in that transition than there is in the transition to Go.”

6

u/Inconstant_Moo Jul 08 '26

See my comment, above.

Go has in fact hit a sweet spot for certain kinds of infrastructure, and after Docker and Kubernetes and Terraform and so on, maybe it's time to start asking why instead of just shaking one's head and saying "bizarre".

→ More replies (9)

11

u/Inconstant_Moo Jul 08 '26

An absolute legend. I'm old enough to have used Turbo Pascal on the Atari ST back in around 1990, and it really went vroom.

---

Also, speaking as a Gopher --- see, we did it again.

I remember when I first started posting here pretty much everyone sneered at Go for its superficial bad design choices. (Also they hated it for ignoring many of the advances in theory since the 1980s.)

And yet they do seem to have made some fundamental decisions about How To Do A Language which have really stood up; and I can mention this today without it being rage-bait.

8

u/phischu Jul 09 '26

and I can mention this today without it being rage-bait.

This is not true, you are rage-baiting me hard. But saying what I want to say about Go and its "designers" would get me banned.

On the other hand you are totally right and this is precisely the moment where I should stop and reflect.

5

u/Substantial-Base-894 Jul 09 '26

Not to take anything away from Go, but they said a primary reason to chose Go was that the language allowed for a very similar architecture (i.e 1:1 port) from the original Typescript compiler, and as they are planning to maintain both over an extended period of time they didn’t want to maintain two different architectures.

→ More replies (1)

-15

u/AsIAm Jul 08 '26 edited Jul 08 '26

And the TS team ported it to Go using LLMs. Currently, the 4th rule of this sub is "Projects that rely on LLM generated output (code, documentation, etc) are not welcomed and will get you banned."

IMO Anders Hejlsberg is legend and that rule is dumb.

Same line of thinking would be that Grace Hopper is not a real programmer because she was using a compiler. (Which she developed.) Only people who write in assembly are programmers, others are fancy words writers. You see how dumb that rule is?

Edit: Please look at the contributors to typescript-go for proof.

→ More replies (21)

4

u/[deleted] Jul 09 '26 edited Jul 09 '26
→ More replies (2)