4 ms·
That's not entirely true. While TypeScript is closely aligning itself with the proposed ES6 syntax for classes and modules, there is no expectation that ECMAScr
by haxorize 13y ago
That's not entirely true. While TypeScript is closely aligning itself with the proposed ES6 syntax for classes and modules, there is no expectation that ECMAScript will add optional static type checking. If you want statically typed JavaScript you are always going to need something like TypeScript.
With that said, as ES6 evolves and becomes more widely supported there will be aspects of the TypeScript compiler that will no longer be needed (e.g. classes, modules, fat arrow functions, etc.).
- k3n 13y ago> If you want statically typed JavaScript you are always going to need something like TypeScript. I think that is a valid statement only within the context of the next ECMA release. In other words, that's not to say that whichever successive version after ES6 can't include it, or any version thereafter.
- jeswin 13y agoYou could make that argument about any missing feature. I haven't seen any serious support for optional typing in JS; so at this point it would be fair to say that GP is correct.
- k3n 13y agoThat is a good point that it could apply to any missing feature; my point is that to say that any particular feature is "never" going to make it into the language is short-sighted at best. Just a handful of years ago, you could say that "if you want some form of Function.prototype.bind then you're always going to have to polyfill it yourself", which of course would be a 100% inaccurate statement.
- itsnotlupus 13y agoWell, there once was a forlorn EcmaScript version, aka ES4, which included rather similar concepts ( http://www.ecmascript.org/es4/spec/overview.pdf http://www.ecmascript.org/es4/spec/overview.pdf ) : > Structural function types describe functions and methods. The type > function (int, string): boolean > describes a Function object that takes two arguments, one int and the other string, and which returns a boolean Given that a great many other concepts from ES4 are finding their ways into ES6, it is not implausible that this one may also reappear into a more consensual specification someday.
- haxorize 13y agoFair enough. I just haven't heard of the ECMAScript standards committee seriously considering adding static type checking to the language. The closest things I've seen are the proposed guards [1] and trademarks [2] features for ES7. [1]: http://wiki.ecmascript.org/doku.php?id=strawman:guards http://wiki.ecmascript.org/doku.php?id=strawman:guards [2]: http://wiki.ecmascript.org/doku.php?id=strawman:trademarks http://wiki.ecmascript.org/doku.php?id=strawman:trademarks