3 ms·
Facebook's Flow and Hack typecheckers both do this.
by spicyj 11y ago
Facebook's Flow and Hack typecheckers both do this.
- wpietri 11y agoIf anybody has used these for serious coding, I'd love to hear more about the experience.
- AgentME 11y agoWe've been using Flow at Streak. Compared to my last experience with TypeScript, it's been really great for how easy it is to add into an existing codebase. Nothing about our build process had to change because we were already using Babel (which by default strips out Flow types and supports JSX) with Browserify. Flow understands node-isms and follows how commonjs and es6 modules include each other, and only enforces its type checking on files that have opted in with the magic /* @flow */ comment, so we didn't have to stop the world and make everything play nice with it in one go. We're gradually opting in more of our codebase over time. Its type system maps to javascript really well, supporting things like optional types, disjoint unions, intersection types, and polymorphic functions and classes. The annoying things with Flow: No Windows support yet which is the one thing holding me back from transitioning some personal projects over, but it sounds like progress is coming there[1]. There doesn't yet seem to be any real plans for letting 3rd party NPM modules bundle their own type definitions and have them be automatically used[2]. (Flow doesn't have issues with untyped imports at least. They're just treated as the any type.) Editor integration is pretty bad still. There's an Atom plugin, but it's buggy. This doesn't affect me too much as the "flow" command for type checking is quick to use (on the first run, it starts a long-running daemon in the background which watches your whole project for changes and keeps their type information cached) in the terminal I already always have open for interacting with git. [1]: https://github.com/facebook/flow/issues/6 https://github.com/facebook/flow/issues/6 [2]: https://github.com/facebook/flow/issues/593 https://github.com/facebook/flow/issues/593
- acconsta 11y agoYeah, although I don't know how parallel it is because OCaml. I think they might have gotten a multiprocess architecture working?