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

"better step in the right direction than the types of tools MS and Google have been putting out"

The Google Closure Compiler (https://developers.google.com/closure/compiler/) has been around for years and years.

It does everything you mentioned (100% optional type annotations, type inference), plus more (dead code removal, inlining, compiler-time constants).



Google Closure: function hello(a){alert("Hello, "+a)}hello(3); Compilation was a success! No warnings No errors

+ it's not incremental hence unusably slow, requires Java. No, Closure is not the same as Flow even from a brief look at both.


That's because it's all valid Javascript - concatenating a string with a number is normal practice even in strongly typed languages (implicit type conversion). So, I don't see your point. If the argument 'a' had an annotation saying it should be a string, then I could understand an error from some checker tool, but then it wouldn't be vanilla JS anymore.




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

Search: