Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Another Facebook project Flow gives similar if not as comprehensive benefits whilst staying in JavaScript.


Does it really stay in JavaScript though?

I'm not familiar with the latest ECMA and standards updates and I suppose I don't really know what modern JS actually looks like, but the example on this page[1] doesn't look like syntactically valid JavaScript to me.

If you write code that has to be compiled before it turns into JavaScript, there's another benefit though... it's that you can never accidentally promote code to a server that hasn't already been vetted by the type-checker!

Or, even run it locally! You are guaranteed that the type checker has been run before the code hits a runtime environment.

Looking at Flow, I'm seeing there's a tool `flow` that you run any time you want to check the types. I think there's a background process way to run flow, that mitigates this issue somewhat... but if Flow is in fact implemented to always be syntactically valid JavaScript, that could be a bad thing.

[1]: https://flow.org/en/docs/usage/


Babel has a bunch of extensions to JavaScript that are widely used. Sounds like it just finds and strips out type annotations.

https://babeljs.io/docs/plugins/syntax-flow/

https://babeljs.io/docs/plugins/transform-flow-strip-types/


Realtime checking is trivial with the appropriate IDE extension and you can always put the type annotations inside comments -

https://flow.org/en/docs/types/comments/


No, Flow is not JavaScript, it's a superset.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: