Hacker News new | ask | show | jobs
by hussainbilal 1252 days ago
The short answer is no. Typescript is not worth it. The reason is because:

- WebAssembley (which other, controversially better or at least more adopted languages also target)

- Javascript's spec. is not time invariant (https://github.com/tc39/proposals#readme)

- Typescript isn't the best solution (There are better less adopted solutions providing types, like Elm, Rescript, or Purescript)

For Javascript, the real solution is hygienic macros and contracts, but because `eval()` can't get no love or safety on the browser side, everyone on the server-side has to suffer.

Ironically, introducing a fake compilation step where Javascript transpiles to Javascript (not like babel.js which targets older JS, but literally just the same lang spec) is the way to side step the `eval()` problem, lol! (expanding those `eval()` in a fake compile step)