logoalt Hacker News

ajrossyesterday at 3:17 PM4 repliesview on HN

Meh. Flaming about this is so exhausting given that the war was already fought and we know who the winner is.

First, that's the typescript compiler, not typescript apps. And it was a ground-up rewrite effort (a very large one) with a specific eye toward improving the performance of the original, which was widely held to be sub-optimal for reasons entirely unrelated to implementation language. Suffice it to say that, hell no, you can't just transpile your code to Go and expect it to run faster. We all know it doesn't work like that.

But more broadly, landing with "Please don't use Electron" in the context of a comment about a MS product seems weird given the implementation framework of Microsoft's single most impactful new UI project of the last decade...

Just stop, basically. You lost. Use Electron. It works great and everyone else already does and proved you wrong.


Replies

mpweiheryesterday at 3:40 PM

> that's the typescript compiler, not typescript apps.

Of course it's the typescript compiler. What else is an implementation of "Typescript" that you could actually make faster? And how would Microsoft go to all Typescript users and re-implement their code in Go? How would that work?

But that doesn't change the simple fact that the Typescript compiler written in Typescript was too slow:

"As your codebase grows, so does the value of TypeScript itself, but in many cases TypeScript has not been able to scale up to the very largest codebases."

And to fix that performance problem, they had to reimplement Typescript (aka "the Typescript compiler") in Go. And that made it 10x faster.

And I am not sure you got "just transpire your code to Go" from, because I sure as hell didn't write it. And if you know it doesn't work like that, and I sure as hell didn't claim it works like that, why did you introduce this straw man?

This is all plain facts.

So yes: please stop the flaming. And please stop using Electron. Dennard scaling hasn't been with us for some time now.

show 1 reply
3836293648yesterday at 5:36 PM

The typescript compiler is a typescript app. Or was, I guess

imtringuedtoday at 8:10 AM

>Meh. Flaming about this is so exhausting given that the war was already fought and we know who the winner is.

I mean yeah its obvious that typescript had insufficient performance for the typescript compiler. They made a big public announcement about the rewrite to golang. It's pretty clear who the winner is.

>First, that's the typescript compiler, not typescript apps. And it was a ground-up rewrite effort (a very large one) with a specific eye toward improving the performance of the original, which was widely held to be sub-optimal for reasons entirely unrelated to implementation language.

The typescript compiler uses v8 as a runtime to run itself and it used to be written in typescript. It was probably one of the biggest typescript apps there is.

Here are some reasons why they chose golang over v8:

* the memory allocation patterns of a compiler were a poor fit for the v8 JIT * the runtime is restricted to a single thread * JITs have to make a tradeoff between startup time and how much time they spend optimizing generated code, AOT compilation can spend more time optimizing while having a faster startup time which is critical for a CLI application, where the JIT cost is paid every time the program is started

You can even look at this blog post and see it for yourself: https://grokkingtechcareer.substack.com/p/the-real-reason-mi...

>Suffice it to say that, hell no, you can't just transpile your code to Go and expect it to run faster. We all know it doesn't work like that.

This is a straw man that nobody is proposing, but even a naive attempt would probably have some benefits, primarily relating to startup time and memory consumption.

>But more broadly, landing with "Please don't use Electron" in the context of a comment about a MS product seems weird given the implementation framework of Microsoft's single most impactful new UI project of the last decade...

>Just stop, basically. You lost. Use Electron. It works great and everyone else already does and proved you wrong.

Use Electron for the typescript compiler? Are you crazy? (note that ajross responded with this comment https://news.ycombinator.com/item?id=48170285)

bigstrat2003yesterday at 11:04 PM

Electron does not, in fact, work great. Apps which use Electron are an absolute drag for the user because they are slow, use a ton of memory, or both. Any developer who cares one iota about the quality of his software will try to avoid Electron.