Hacker News new | past | comments | ask | show | jobs | submit login

With TypeScript [1] you can get the best of both worlds: statically checked code with tool-assisted refactoring plus the ability to drop down to JS when the type system doesn't support what you want to do. (Of course, you'll now need to be careful about it and try to isolate the dynamic code from the rest of the system and present a static facade to it)

[1]: http://www.typescriptlang.org/




I've thought that if you're going to go the route of compiling to JS, you might as well go to a higher level of abstraction and use something like PureScript, Haxe, or any of the 100 other languages that compile to JS. Of course, interop then becomes a problem.


Thats precisely why I suggest TypeScript or Facebook's flow, as interop is a non-issue. They're both just ES6 + optional types.

The trouble with PureScript is that its different enough to have a different cost model (in terms of performance) thanks to the pervasive closure allocations resulting from currying as well as the typeclass dictionaries. Though I'm sure that once the compiler matures and those costs are eliminated, it would be the best choice.

There is also TypeScript's tooling - while the language is less safe, the language service tools are a lot more advanced than PureScript's (I can't say if the same applies for Haxe though)




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: