For example, you should write a function assertPerson in which you must check its input and output with Flow syntax
Not sure what your concern here, but if you worry that you will need to use flow syntax and it will be incompatible with good old JS, this is not the case. See source code of sarcastic it is absolutely valid JS, but at the same time, it is type-checked by Flow.
So I think, if I want to, I can create a bridge too
For sure. I think it will be a cool feature. Even cooler if you can get support for both TypeScript and Flow. 👍
for the first point. I do not think flow will help you to check data type during run time, in fact, the checking is done by your own code logic, not by flow static system.
And in my opinion, Flow or Typescript make a way to access static data type, but weaken js flexibility, and make project code library bigger and bigger. It is for a big project with different level of developers, not for small projects or which developed by experienced developers.
Not sure what your concern here, but if you worry that you will need to use flow syntax and it will be incompatible with good old JS, this is not the case. See source code of sarcastic it is absolutely valid JS, but at the same time, it is type-checked by Flow.
For sure. I think it will be a cool feature. Even cooler if you can get support for both TypeScript and Flow. 👍
for the first point. I do not think flow will help you to check data type during run time, in fact, the checking is done by your own code logic, not by flow static system.
And in my opinion, Flow or Typescript make a way to access static data type, but weaken js flexibility, and make project code library bigger and bigger. It is for a big project with different level of developers, not for small projects or which developed by experienced developers.
Checkout my post about IO validation, it shows how to make a bridge between static types (Flow or TypeScript) and runtime type checking.
If you wonder why one need types, read my post on how types help to prevent bugs here