Profile picture
Gary Bernhardt @garybernhardt
, 15 tweets, 3 min read Read on Twitter
In 2008, I was extremely frustrated by Ruby imposing a constant ~100 ms startup penalty on hello world. In 2018, computers are ~3.5 times faster (4479 vs. 1266 Geekbench for 2007 vs. 2017 MBP). TypeScript imposes a 1600 ms startup penalty on hello world. en.wikipedia.org/wiki/Wirth%27s…
That's just time to `tsc hello.ts`; it doesn't even include execution.
A 1400 ms constant startup overhead immediately precludes entire classes of programming flow!
People are already replying to tell me that this is unfair; TS is compiled. OK. Here are some other runtimes for hello world. Each includes full compile-link-execute cycle.

Clang: 39 ms (0.028x TS)
Golang: 104 ms (0.073x TS)
Haskell: 146 ms (0.10x TS)
OCaml: 15 ms (0.011x TS!)
(Nevermind the fact that Ruby is compiling the source before executing it. It's not as if it's crawling a parse tree; it's not 1995.)
"This doesn't matter if you leave the compiler running." Now you have 2**Δt problems.
"Just leave it running" does not "solve" slow startup. It will occasionally fail in some weird way. You will think that the failure is your fault and try to debug it for three hours before thinking to restart the hidden, but stateful, long-running build process.
Computers exist to serve us, not the other way around. If it is not fast and reliable then it is wrong!
People interpret any criticism as "x is Morally Bad", so: this is not a "TypeScript is bad" thread. It's a "dev tools should be fast to empower programmers, and 'just leave it running' will bite you because hell is real, I have seen it, and it is long-running state" thread.
the adjacency of the long-running-state-is-hell bit of this tweet and the word "thread" was accidental but I retroactively welcome it
To everyone saying "long-running stateful systems aren't doomed to flakiness; you just have to write them correctly" in defense of TS: how do you feel about this sentence? "Code in dynamically-typed languages isn't doomed to flakiness; you just have to write it correctly."
Insufficiently jaded developers will see this as scare mongering. It is not; the state trap is consistent. For example: IDEs inevitably succumb to it. Here are some Google searches for your reading pleasure. google.com/search?q=%22vi… google.com/search?q=%22xc… google.com/search?q=%22in…
When a problem consistently recurs over decades, in many languages, in many communities, we should seek a higher-level fix. For state, the easiest solution is so just eliminate the state. Cold boot the tool (here, compilation toolchain) every time. But that requires fast startup.
I bet that every core developer on TypeScript has restarted an IDE hundreds or thousands of times in their life – not understanding exactly how it had broken itself, but knowing that it was in a bad state and needed a restart. And here we go down the same old path again!
I wish I'd written this thread in reverse order. Oh well.
Missing some Tweet in this thread?
You can try to force a refresh.

Like this thread? Get email updates or save it to PDF!

Subscribe to Gary Bernhardt
Profile picture

Get real-time email alerts when new unrolls are available from this author!

This content may be removed anytime!

Twitter may remove this content at anytime, convert it as a PDF, save and print for later use!

Try unrolling a thread yourself!

how to unroll video

1) Follow Thread Reader App on Twitter so you can easily mention us!

2) Go to a Twitter thread (series of Tweets by the same owner) and mention us with a keyword "unroll" @threadreaderapp unroll

You can practice here first or read more on our help page!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just three indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member and get exclusive features!

Premium member ($3.00/month or $30.00/year)

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!