4 ms·
That's why I'd personally prefer Flow for that. It has a more elaborate type system anyway. [1] Moreover, Flow is pure annotation, which can be removed by Babe
by vog 10y ago
That's why I'd personally prefer Flow for that. It has a more elaborate type system anyway. [1]
Moreover, Flow is pure annotation, which can be removed by Babel. And Flow is also backed by a large company (Facebook instead of Microsoft).
However, if you do want to generate JS, use a language that elminiates runtime errors almost completely, such as Elm or OCaml (through bucklescript or js-of-ocaml).
[1] The following presentation contains some scary examples of incorrect code not rejected by Typescript. I'd rather prefer Flow which errs on beeing too strict: https://djcordhose.github.io/flow-vs-typescript/elm-flow-typescript.html#/ https://djcordhose.github.io/flow-vs-typescript/elm-flow-typ...
- throwasehasdwi 10y agoYour comment neglects to mention that Typescript debugging is generally easy because one of the design goals of typescript is to produce javascript that matches what a developer would write. Debugging javascript produced by Babel is generally hell in comparison. The transforms done by Babel are not designed to be human readable and they generally aren't.
- vog 10y agoWhoops, you are right. Removed the misleading part of my comment.
- deleted 10y ago[deleted]
- coldtea 10y ago>And Flow is also backed by a large company (Facebook instead of Microsoft). Only Facebook doesn't care much to back or promote Flow, besides the occasional blog post, whereas Microsoft has created a whole IDE / VS Code support for it, great tooling, documentation, etc.