Re: ES6 “modes” and user-friendliness

2012-01-17 Thread Axel Rauschmayer
I think you've misunderstood. There's nothing in my New Year's email about getting ES6 semantics when you find an occurrence of a particular feature (that kind of thing was just a side conversation in the mega-thread, and a very ill-conceived one IMO). The proposal is that within the

Re: Block Lambdas: break and continue

2012-01-17 Thread Brendan Eich
Grant Husbands January 16, 2012 5:33 PM Brendan Eich wrote: 2. Variation on empty label: support "do" as a reserved-identifier label do: arr.forEach {|o| if (...) break; ... } This seems like a sound way of doing it, indeed (I omitted your first one because I prefer

Re: A different semantics for WeakMap#get default value

2012-01-17 Thread David Bruant
Le 17/01/2012 01:46, Kris Kowal a écrit : On Mon, Jan 16, 2012 at 4:39 PM, Andrea Giammarchi andrea.giammar...@gmail.com wrote: then the method should be called getOrSetIfNotThere(obj, def) 'cause get() would mislead too much I’ve been calling this method getset for about three years, hoping

Re: ES6 “modes” and user-friendliness

2012-01-17 Thread Axel Rauschmayer
1. module = ES6 – some changes break with ES5.strict some changes break with ES5.strict is confusing -- do you mean 'let' works instead of being a future reserved word, whereas in (3, below) 'let' is not reserved at all? I’m not sure about specifics, I mean “ES6 things that are not

Re: A different semantics for WeakMap#get default value

2012-01-17 Thread David Bruant
Le 17/01/2012 01:53, Kris Kowal a écrit : For what it’s worth, Python dictionaries have .get(key, default) and .setdefault(key, default). The former is non-mutating. Its behavior is also different depending on arguments length. If the default is not passed, it will throw an exception. If a

Re: ES6 “modes” and user-friendliness

2012-01-17 Thread Axel Rauschmayer
But in practice, strict mode can fade away as a transitional concept from ES5 that, while still spec'ed and implemented, doesn't get used much in practice. Modules carry the torch of ES5-strict and take it even further, and become the actual mode that gets used in practice, both because it

Re: Block Lambdas: break and continue

2012-01-17 Thread Axel Rauschmayer
To complete the Smalltalk homage we would want this [the label do:] in expressions, and we'd also want do: to take a block-lambda directly, in addition to a CallWithBlockArguments. Minor possibility of future-hostility: Should real keyword arguments ever make it to ECMAScript, labels such

Re: ES6 “modes” and user-friendliness

2012-01-17 Thread Lasse Reichstein
On Tue, Jan 17, 2012 at 7:30 AM, Axel Rauschmayer a...@rauschma.de wrote: Nitpick - None of the above = ES3 semantics That should be ES5 (non-strict) semantics. There are (a few) incompatible changes between ES3 and ES5, and you don't want to reintroduce the ES3 behavior (e.g., RegExp literal

Re: ES6 “modes” and user-friendliness

2012-01-17 Thread Axel Rauschmayer
But in practice, strict mode can fade away as a transitional concept from ES5 that, while still spec'ed and implemented, doesn't get used much in practice. Modules carry the torch of ES5-strict and take it even further, and become the actual mode that gets used in practice, both because it

Re: Harmony modules feedback

2012-01-17 Thread Mariusz Nowak
Andrea Giammarchi-2 wrote: You are underlying my points too .. I am dealing on daily basis with highly dependent little modules and the build procedure takes care of packing everything together before deployment. However, we are using a synchronous version of require, similar to the one

Re: Harmony modules feedback

2012-01-17 Thread Mariusz Nowak
rauschma wrote: @Andrea, Mariusz: Are you aware of the RequireJS optimizer [1]? It can be used together with almond [2], an AMD loader with minimal footprint. [1] http://requirejs.org/docs/optimization.html [2] https://github.com/jrburke/almond @Axel I read about it before, when we

Re: A different semantics for WeakMap#get default value

2012-01-17 Thread Herby Vojčík
Brendan Eich wrote: Clearly(!) a set-if-not-present method should not be misnamed get. I like the optional sentinel-meaning-not-found for get, and setDefault per Python as Tab pointed out. Agree they should not be merged into one API. Bikeshedding setDefault at leisure (in background in my head

Re: String.prototype.[de]normalize and .isCharXxx are needed

2012-01-17 Thread Herby Vojčík
Norbert Lindenberg wrote: Nothing planned at this point. Unicode normalization would be a natural candidate for the Globalization API, but it's not in scope for version 1. Support for Unicode character properties probably Maybe it could be added? should be part of regular expressions, as

Re: ES6 opt-in, reloaded

2012-01-17 Thread Andreas Rossberg
On 16 January 2012 23:18, David Herman dher...@mozilla.com wrote: The goal that is missing, and what I believe is the single most important part of my New Year's email, is: 9. Allow programmers to continue thinking of JS as a single cohesive language. This is a relative concept rather than

Re: ES6 opt-in, reloaded

2012-01-17 Thread Andreas Rossberg
On 17 January 2012 03:12, David Herman dher...@mozilla.com wrote: The only way to avoid refactoring pitfalls entirely is to avoid making any changes in the language altogether. I disagree, see my previous reply. It depends on what class of refactoring pitfalls you are talking about. I

Re: ES6 opt-in, reloaded

2012-01-17 Thread Herby Vojčík
Andreas Rossberg wrote: On 16 January 2012 23:18, David Hermandher...@mozilla.com wrote: The goal that is missing, and what I believe is the single most important part of my New Year's email, is: 9. Allow programmers to continue thinking of JS as a single cohesive language. This is a

Re: ES6 opt-in, reloaded

2012-01-17 Thread Claus Reinke
So I'd have to write use version 6; module {...} instead of just module {...} even though there's no backward compatibility issue? That's just mean! :-| Why? Assuming that modules work out, they will be in ES7,8,.. as well. So, 'module' isn't sufficient to identify ES6. At best,

Re: ES6 “modes” and user-friendliness

2012-01-17 Thread Allen Wirfs-Brock
I think mode terminology is quite misleading, particularly in regard to run time semantics. For Es5 (and I believ es6) there is no need of for a global runtime mode bit that is analagous to a cpu mode bit that ambiently changes the semantics of some or all instruction.  Instead, we have

Re: ES6 “modes” and user-friendliness

2012-01-17 Thread Allen Wirfs-Brock
Most of the extended code early errors I list in a previous message on this thread are examples of changes that are not backward compatable with Es5 strict code that Axel is talking about belowAxel Rauschmayer a...@rauschma.de wrote:Ss1. module = ES6 – some changes break with ES5.strict some

Re: Better Native XML Support

2012-01-17 Thread Isaac Schlueter
I think that requiring a user load a parser to handle XML is perfectly fine. That's the state of the art in most programming languages. On Mon, Jan 16, 2012 at 09:51, David Bruant bruan...@gmail.com wrote: Le 16/01/2012 18:30, Nuno Job a écrit : Hi guys, I would like to make the case for

Re: Harmony modules feedback

2012-01-17 Thread James Burke
On Tue, Jan 17, 2012 at 3:34 AM, Mariusz Nowak medikoo+mozilla@medikoo.com wrote: James Burke-5 wrote: This is provably false. You normally do not need hundreds of modules to build a site. I wasn't theorizing, I was talking about real applications that are already produced. What I was

new ES6 specification draft

2012-01-17 Thread Allen Wirfs-Brock
An updated draft is available at the usual place (http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts ) That draft incorporated decisions made at the Nov. 2011 TC39 meeting. However, note that this draft also contains a significant amount of still in flight work.

Re: Harmony modules feedback

2012-01-17 Thread Wes Garland
On 16 January 2012 14:20, Andrea Giammarchi andrea.giammar...@gmail.comwrote: var module = require(module); is totally fine but require(module, function (module) { // is totally fine too }); latter could be synchronous in node.js and asynchronous in the web, who cares, as long as it

It's been a long time coming...

2012-01-17 Thread Dave Fugate
...but test262 finally standshttps://bugs.ecmascript.org/buglist.cgi?product=Test262component=Testsresolution=---list_id=777 at zero (known) invalid test cases as of an hour ago! Changeshttp://wiki.ecmascript.org/doku.php?id=test262:test_case_format contributed by Mark Miller last year

Re: Better Native XML Support

2012-01-17 Thread Grant Husbands
David Bruant wrote: Have a look at quasis [1]. It provides what I'd consider to be a more generic and safer solution to E4X. E4X is more than just data production, though. It added a number of accessors/syntax for handling XML elements, many of which can be the LHS of an assignment: expr..ident

Re: Better Native XML Support

2012-01-17 Thread Russell Leggett
If you desperately need it, you should be able to make a library for it, and then if you need the extra syntax, add an extra compile step - like what coffeescript does. After all, e4x is just an extension to JS, it should be possible to add the data types natively and then make any e4x code work

Re: A different semantics for WeakMap#get default value

2012-01-17 Thread Allen Wirfs-Brock
On Jan 17, 2012, at 3:45 AM, Herby Vojčík wrote: Brendan Eich wrote: Clearly(!) a set-if-not-present method should not be misnamed get. I like the optional sentinel-meaning-not-found for get, and setDefault per Python as Tab pointed out. Agree they should not be merged into one API.

Re: Block Lambdas: break and continue

2012-01-17 Thread Grant Husbands
Allen Wirfs-Brock wrote: do: arr.alternate ({|o| if (...) continue; if (...) break; ...}, {|o| if (...) continue; ...}); I don't see how this can support the most likely intended semantics I think others might have better answers, but it seems that the meaning of 'break' is to stop the whole

Re: Globalization API holiday summary

2012-01-17 Thread Allen Wirfs-Brock
On Jan 16, 2012, at 7:45 PM, Norbert Lindenberg wrote: On Dec 8, 2011, at 10:25 , Nebojša Ćirić wrote: Proposed changes to the original API: [snip] 2a. What happens with toLocaleString methods when user doesn't load @globalization module? I think they should work as specified in the

Re: Better Native XML Support

2012-01-17 Thread Wes Garland
On 17 January 2012 13:05, Russell Leggett russell.legg...@gmail.com wrote: After all, e4x is just an extension to JS, it should be possible to add the data types natively and then make any e4x code work as syntactic sugar, which you can desugar yourself. I don't really know the details, but

Re: A different semantics for WeakMap#get default value

2012-01-17 Thread Herby Vojčík
Allen Wirfs-Brock wrote: On Jan 17, 2012, at 3:45 AM, Herby Vojčík wrote: Brendan Eich wrote: Clearly(!) a set-if-not-present method should not be misnamed get. I like the optional sentinel-meaning-not-found for get, and setDefault per Python as Tab pointed out. Agree they should not be

Re: Better Native XML Support

2012-01-17 Thread Russell Leggett
On Tue, Jan 17, 2012 at 1:30 PM, Grant Husbands esdisc...@grant.x43.netwrote: Russell Leggett wrote: If you desperately need it, you should be able to make a library for it, and then if you need the extra syntax, add an extra compile step I was simply making sure everyone was on the same

Re: ES6 opt-in, reloaded

2012-01-17 Thread Brendan Eich
Andreas Rossberg January 17, 2012 4:49 AM On 16 January 2012 19:35, Brendan Eich bren...@mozilla.org wrote: new ES6 features to classic mode, as has been proposed by several people, clearly works against (3), I object. 3 is misstated to assume "switching" means

Re: Unblocking sleep semantics

2012-01-17 Thread Axel Rauschmayer
More material: http://calculist.org/blog/2011/12/14/why-coroutines-wont-work-on-the-web/ On Jan 17, 2012, at 21:30 , Dean Landolt wrote: You can get these semantics with generators plus a library (see Dave Herman's task.js [1] as a great example). As generators your `return function;`

Re: Unblocking sleep semantics

2012-01-17 Thread David Bruant
Le 17/01/2012 21:38, Axel Rauschmayer a écrit : More material: http://calculist.org/blog/2011/12/14/why-coroutines-wont-work-on-the-web/ ... and a link to the proposal: http://wiki.ecmascript.org/doku.php?id=harmony:generators ;-) David ___

Re: Unblocking sleep semantics

2012-01-17 Thread Dean Landolt
On Tue, Jan 17, 2012 at 3:54 PM, Jussi Kalliokoski jussi.kallioko...@gmail.com wrote: Yeah, I was aware of the coroutines in generators, that's why I said it would be sort of sugar. :) But it's not sugar, it's a different feature. It's the difference between shallow and deep continuations.

Re: Unblocking sleep semantics

2012-01-17 Thread Jussi Kalliokoski
Okay, now that I've been re-reading how generators work and about task.js, it has made me realize my error. Yes, you're right, what I've made is actually deep continuations, and that's not really what I had in mind. Thanks everyone, I'll try to think of a better way to do this (or to find out if

Re: new ES6 specification draft

2012-01-17 Thread Herby Vojčík
Allen Wirfs-Brock wrote: An updated draft is available at the usual place (http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts ) That draft incorporated decisions made at the Nov. 2011 TC39 meeting. However, note that this draft also contains a significant amount of still in

Re: Block Lambdas: break and continue

2012-01-17 Thread Brendan Eich
Axel Rauschmayer January 17, 2012 1:04 AM Minor possibility of future-hostility: Should real keyword arguments ever make it to ECMAScript, labels such as "do:" seem an obvious choice. No, JS doesn't allow reserved identifiers to be used as parameter names in any case.

Re: Block Lambdas: break and continue

2012-01-17 Thread Brendan Eich
Grant Husbands January 17, 2012 10:14 AM I think others might have better answers, but it seems that themeaning of 'break' is to stop the whole statement, and the meaning of'continue' is to skip the inner block and hence return toarr.alternate That's what I was

Re: String.prototype.[de]normalize and .isCharXxx are needed

2012-01-17 Thread Norbert Lindenberg
In order to get version 1 of the Globalization API done and into the hands of users, we're no longer considering new functionality for this version. On the other hand, string comparison (collation) is already included in this version, and the sensitivity option lets you choose whether it should

Re: Block Lambdas: break and continue

2012-01-17 Thread Allen Wirfs-Brock
On Jan 17, 2012, at 10:14 AM, Grant Husbands wrote: Allen Wirfs-Brock wrote: do: arr.alternate ({|o| if (...) continue; if (...) break; ...}, {|o| if (...) continue; ...}); I don't see how this can support the most likely intended semantics I think others might have better answers, but

ES6 Collections Polyfill

2012-01-17 Thread Andrea Giammarchi
Somebody may be interested into ES6 Map, WeakMap, and Set Here my attempt with all explanations: https://github.com/WebReflection/es6-collections The code must work in every browser/JS engine, reasons about weakness choice listed too. Now you know, feedbacks welcome br