4 ms·
I completely agree. It's like they did not learn from javascripts mistakes and just continue doing them. Global Scope: not fixed. No integer: not fixed. Syntax
by igl 12y ago
I completely agree. It's like they did not learn from javascripts mistakes and just continue doing them.
Global Scope: not fixed. No integer: not fixed.
Syntax to resemble JAVA more closely in a class-less language that already as 9999999999999 class libraries: FIXED
- gsnedders 12y agoHow can you fix the global scope without breaking almost all existing JS code? Browsers will never ship anything that breaks large numbers of existing websites (users don't use browsers that don't work with the web!). Adding an integer type is far easier said than done. It was decided to leave that hard problem to ES7; integer type (or types!) are certainly coming.
- BugBrother 12y ago>> How can you fix [X] without breaking almost all existing [Y] code? For most cases of X, some form of declaration that is scope bound. Look at e.g. Perl, it changes quickly in this way, with very good backwards compatibility. [Also see strict mode, of course.] Edit: That said, new keywords like those let/const/module/extends etc should work fine. Please give me them today. Edit 2: I have been cursing the lack of multiple returns this week. It is a pain returning a hash/object or an array. That really isn't supported, from browsing the standard? :-(
- espadrine 12y ago> Edit 2: I have been cursing the lack of multiple returns this week. It is a pain returning a hash/object or an array. Why is that? let rational = (a, b) => [a, b]; let [numerator, denominator] = rational(38, 4); let reduced = rational(numerator/2, denominator/2); PS. The above code works in stable Firefox.
- BugBrother 12y ago>> Why is that? <Cough> Obviously because I'm blind? :-) Thanks.
- gsnedders 12y agoThere's an unwillingness to introduce too many opt-ins into JS as it quickly leads to ever increasing implementation complexity. Note that Perl is one of the few notable languages to have such sort of opt-ins.
- jkrems 12y ago* All modules are automatically in strict mode, so global scope: fixed? * `new StructType({x:uint32, y:uint32, color:Color})` - looks like integers to me..?
- espadrine 12y agoI didn't add TypedArray because technically that was first spec'ed by Khronos for WebGL, but you already have integers in every modern browser right now, and it will be in ES6 as well!