DEV Community

Akshat
Akshat

Posted on

How does TypeScript or Flow compare to transpile-to-JS languages like Elm, ReasonML or PureScript?

Top comments (1)

Collapse
 
deciduously profile image
Ben Lovy

Depends what you mean by "compare". Tooling-wise there is little difference - Elm uses its own tools but Reason and PureScript both leverage the same node-based tooling you're used to. TypeScript and Flow are additions over JavaScript, whereas the others are different languages with their own semantics and tradeoffs. Reason attempts to use a syntax that's specifically familiar to JavaScript developers, but it's still OCaml at the end of the day. Elm and PureScript are both purely functional, so using them is a rather different experience than using JavaScript but still very productive. They have a more Haskell-like syntax.

Using any of them, you're going to write your code and then pass it through a set of steps to execute it in the browser using a tool to automate the process. The biggest difference in development experience (in my opinion) is that the compile-to-JS languages tend to offer better help at the compile stage - though TypeScript is pretty great here too, I prefer both the Reason and Elm compilers for error messages and fast performance.

The specific language is a matter of taste.