Hacker News new | ask | show | jobs
by kyrre 3897 days ago
How about using JavaScript with flow?
2 comments

> How about using JavaScript with flow?

Flow is not really fundamentally different from Typescript. The syntax is almost the exact same.

I tried them out side-by-side for the same project a few months ago. The main difference was that Typescript was installable through npm and simply read and wrote files to the directory, whereas Flow required an OCaml binary and ran a client-server setup that required some fiddling to get working.

Flow is designed to work better with React, so it has that going for it, but if you're not using React, Typescript is almost exactly the same.

We considered Flow initially as well - but aside from its built-in maybe types (we use Monapt for this!), it's a subset of TypeScript feature-wise that doesn't iterate as quickly.
Side question: when evaluating/updating Monapt did you take a look at any of the "Fantasy Land" compliant implementations? (https://github.com/fantasyland/fantasy-land)
Ah! I think I saw this awhile back. I didn't refer to it too much when working on Monapt since it seems to serve a more abstract purpose, and since Monapt's original purpose was to emulate Scala syntax.
Which feature are you using in TypeScript that wasn't in Flow?
let, const, decorators, string interpolation, other ES6/7 goodies. Also a few other compelling things like abstract classes and community type definitions.