Re:Goodbye CoffeeScript, Hello TypeScript
by WorldMaker on Tuesday October 20, 2015 @02:33PM
(#10420882)
Typescript isn't exactly a pseudo-language. It looks just like JavaScript with Flow annotations. In fact, Typescript is intended to be JavaScript + Type Annotations, so it's just as "native" as JavaScript + Flow annotations, with the addition of some Babel-style ES6 transpiling as well. The only difference is the explicit build process versus running the transforms in browser, and I've seen projects use the Typescript compiler (itself written in JS) as their in-browser transpiler (SystemJS supports it as a first-class transpiler option alongside Babel and Traceur, even).
Re:Goodbye CoffeeScript, Hello TypeScript
by abritinthebay on Tuesday October 20, 2015 @05:55PM
(#10422080)
> It looks just like JavaScript with Flow annotations.
It looks close to that, yes. However Flow can be also implemented via comments to native JS so... TS can't do that.
In which case...
> it's just as "native" as JavaScript + Flow annotations
is wrong. TypeScript requires a transpilation step. Flow doesn't. It can do, but it's not required.
I may have been a little harsh with the "pseudo-language" but I'm not sure what else to call something that is designed to be transpiled into the right language. It's not higher-level, it's sort of... a companion language I guess.
Better - it removes that ability for deliberate bad behavior by devs.
That said - I prefer JavaScript + Flow as thats a much more native solution which means you don't need to learn a pseudo language first.