I was really hoping for Haskell-level type inference with HM stuff, which could be annotated through comments. So I guess it’s time to start that side project of mine…
I wonder this would work with things like Traceur.
Not sure this thing works on ECMAScript 6, and the generated code by the compiler doesn’t contain type annotations, so I don’t immediately see a way to insert it in the compilation toolchain of non-plain JS projects.
Not that it detracts from the value this tool could offer stand-alone.
I would love some kind of offline type checking for my JS code, but I also really enjoy using ES6 modules today, and I’m not sure I would give that up in order to gain static type checking.
If you’re using Traceur, you might want to play around with the AtScript options. https://github.com/google/traceur-compiler/issues/1430
I have the same questions. I’m quickly getting to the point where I need a pipelining compiler, something that can take a source file and push it through (theoretically) Flow -> JSX -> Traceur. You have to move through JSX to remove the type annotations. JSX is aware of many ES6 features, but I don’t know about all of them. If you wanted to add Sweet.js into the pipeline I think you would be hosed.
I still write a lot of CoffeeScript, and would love to put together a dialect that supported the Flow annotations.
Traceur supports type annotations to some extent as an experimental feature, but I’ve never tried it.
The type annotations are also part of the plan for ES Harmony as far as I can tell, with the Flow syntax being one of the options.