Re:TypeScript and the Road to 1.0
by jeswin on Thursday October 17, 2013 @11:34AM
(#6566028)
You 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.
[ Parent
| on HN ]
Re:TypeScript and the Road to 1.0
by itsnotlupus on Thursday October 17, 2013 @12:21PM
(#6566358)
Well, there once was a forlorn EcmaScript version, aka ES4, which included rather similar concepts ( 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.
That 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.