← Back to context

Comment by afdbcreid

4 hours ago

> There are precisely two languages that make the most sense to implement the TypeScript compiler in: Rust and TypeScript itself.

Incorrect. I can maybe agree that those are the only perfect languages to implement tsc in them (if there is such thing). But in the real world, "perfect" does not actually mean "it's a good idea". Go made the most sense to port to (especially before agents), more than Rust (although C# could also be a good idea IMO).

C#'s embeddability/interop story is even worse than Go's; IIUC this was the primary reason they chose not to use it.

  • C#'s embeddability/interop story is as good or better than Golang's. The primary reason they chose not to use it was that C# was seen as too verbose compared to the TS original source. In particular TS used a lot of top level functions and bare/anonymous data types and while C# has picked up top level function support it's still not "idiomatic" and while C# has a long standing anonymous data type support it's not very "ergonomic", certainly not compared to TS structural typing. Golang's traits are a bit more ergonomic by comparison, unfortunately.

    I also still think C# would have been a better long term option for maintainability, but I'm not on the Typescript team and didn't get a vote, and I can understand their methodology even if I don't agree with it.