Re: A few arrow function specification issues

2012-04-24 Thread Brendan Eich
Douglas Crockford wrote: On 4/23/2012 6:41 PM, Mark S. Miller wrote: On Mon, Apr 23, 2012 at 6:30 PM, Allen Wirfs-Brock al...@wirfs-brock.com mailto:al...@wirfs-brock.com wrote: The point is that much of what is done on the web is not high integrity computation. It is essential that

Re: A few arrow function specification issues

2012-04-24 Thread Douglas Crockford
On 4/24/2012 1:28 PM, Brendan Eich wrote: http://www.imdb.com/title/tt0076759/quotes?qt=qt0440727 http://www.imdb.com/title/tt0121766/quotes?qt=qt0333083 ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: A few arrow function specification issues

2012-04-24 Thread Allen Wirfs-Brock
On Apr 24, 2012, at 1:28 PM, Brendan Eich wrote: Douglas Crockford wrote: On 4/23/2012 6:41 PM, Mark S. Miller wrote: On Mon, Apr 23, 2012 at 6:30 PM, Allen Wirfs-Brock al...@wirfs-brock.com mailto:al...@wirfs-brock.com wrote: The point is that much of what is done on the web is not

Re: A few arrow function specification issues

2012-04-24 Thread Brendan Eich
Allen Wirfs-Brock wrote: Back to the original point, which was that making strict mode delete throw when applied to a non-configurable property is not significantly higher integrity than the non-strict behavior of returning false when a property can not be deleted.

Re: A few arrow function specification issues

2012-04-23 Thread Alex Russell
On Apr 23, 2012, at 10:15 AM, Andreas Rossberg wrote: On 21 April 2012 01:22, Allen Wirfs-Brock al...@wirfs-brock.com wrote: Here are a few design alternates that have come up as I work the specification draft for arrow functions 1) Always strict? Should all arrow functions be considered

Re: A few arrow function specification issues

2012-04-23 Thread Kevin Smith
I'd prefer if concise method syntax stayed simple syntactic sugar for functions. Methods obviously need dynamic this. If you combine that with changes like the above, then you have implicitly introduced a third kind of function that cannot be described as (simple) syntactic sugar for any of

Re: A few arrow function specification issues

2012-04-23 Thread Brendan Eich
Andreas Rossberg wrote: To be honest, that suggestion confirms one of my fears about 1JS -- ending up with a more complicated language with ad-hoc rules about which mode applies in which context. Please let's try to resist the temptation. As much as I would like to encourage strict mode, I think

Re: A few arrow function specification issues

2012-04-23 Thread Herby Vojčík
Andreas Rossberg wrote: On 21 April 2012 01:22, Allen Wirfs-Brockal...@wirfs-brock.com wrote: 7) All of the above questions also apply to functions defined using concise method syntax in object literals or classes. Should the same answers apply to them? I'd prefer if concise method syntax

Re: A few arrow function specification issues

2012-04-23 Thread Allen Wirfs-Brock
On Apr 23, 2012, at 8:19 AM, Brendan Eich wrote: Andreas Rossberg wrote: To be honest, that suggestion confirms one of my fears about 1JS -- ending up with a more complicated language with ad-hoc rules about which mode applies in which context. Please let's try to resist the temptation. As

Re: A few arrow function specification issues

2012-04-23 Thread Brandon Benvie
6) Do arrow functions need to have per instance caller and arguments poison pill properties? I propose no, because they are a new feature. But we can include a NOTE warning against providing their non-standard legacy implementation. For simplicity and uniformity, I'd keep the same

Re: A few arrow function specification issues

2012-04-23 Thread Brendan Eich
Brandon Benvie wrote: 6) Do arrow functions need to have per instance caller and arguments poison pill properties? I propose no, because they are a new feature. But we can include a NOTE warning against providing their non-standard legacy implementation. For

caller poison pills, revisited (Was: A few arrow function specification issues)

2012-04-23 Thread Allen Wirfs-Brock
On Apr 23, 2012, at 10:18 AM, Brandon Benvie wrote: 6) Do arrow functions need to have per instance caller and arguments poison pill properties? I propose no, because they are a new feature. But we can include a NOTE warning against providing their non-standard legacy

Re: caller poison pills, revisited (Was: A few arrow function specification issues)

2012-04-23 Thread Brendan Eich
Allen Wirfs-Brock wrote: This raises the issue that ES5.1 overlooked poisoning caller/arguments for Function.prototype. Only function object created using the algorithm in 13.2 have the the poison pill properties and Function.prototype is not specified using 13.2. Function.prototype is

Re: caller poison pills, revisited (Was: A few arrow function specification issues)

2012-04-23 Thread Allen Wirfs-Brock
On Apr 23, 2012, at 11:15 AM, Brendan Eich wrote: Allen Wirfs-Brock wrote: This raises the issue that ES5.1 overlooked poisoning caller/arguments for Function.prototype. Only function object created using the algorithm in 13.2 have the the poison pill properties and Function.prototype is

Re: caller poison pills, revisited (Was: A few arrow function specification issues)

2012-04-23 Thread Brendan Eich
Allen Wirfs-Brock wrote: caller and arguments properties on functions are a non-standard extension, Right you are: js Function.prototype.caller null js Function.prototype.arguments null and of course this is heap not code, so strictness doesn't enter into it. Still happy to change our

Re: caller poison pills, revisited (Was: A few arrow function specification issues)

2012-04-23 Thread Domenic Denicola
I'm becoming increasing convinced that the poison pill approach to securing the caller chain is a poor approach. We keep finding leaks in and it does nothing to prevent implementation from inventing new ways to expose the stating they are trying to hide. I now think we would be better off

Re: caller poison pills, revisited (Was: A few arrow function specification issues)

2012-04-23 Thread Brendan Eich
The threat (not sure how real) is not a string telling the backtrace, it's an object reference to an ancestor function in the call stack. /be Domenic Denicola wrote: I'm becoming increasing convinced that the poison pill approach to securing the caller chain is a poor approach. We keep

Re: caller poison pills, revisited (Was: A few arrow function specification issues)

2012-04-23 Thread Mark S. Miller
On Mon, Apr 23, 2012 at 11:15 AM, Brendan Eich bren...@mozilla.org wrote: Allen Wirfs-Brock wrote: This raises the issue that ES5.1 overlooked poisoning caller/arguments for Function.prototype. Only function object created using the algorithm in 13.2 have the the poison pill properties and

Re: caller poison pills, revisited (Was: A few arrow function specification issues)

2012-04-23 Thread Mark S. Miller
On Mon, Apr 23, 2012 at 11:42 AM, Brendan Eich bren...@mozilla.org wrote: The threat (not sure how real) is not a string telling the backtrace, it's an object reference to an ancestor function in the call stack. The ancestor function leak is vastly worse than the backtrace into leak, but both

Re: A few arrow function specification issues

2012-04-23 Thread Brendan Eich
Brendan Eich wrote: Without arguments runtime semantic shifts, and with |this| lexical, there aren't many strict mode changes left IIRC, and they are pretty edgy edge cases. Dave Herman pointed out the shift for |this|-binding in function nested in arrow, under the proposal that arrow

Re: A few arrow function specification issues

2012-04-23 Thread David Herman
On Apr 21, 2012, at 1:38 PM, Angus Croll wrote: a function shouldn’t work radically (and silently!) different depending on how it is invoked every current JS function behaves exactly this way :-) No, not at all. What Axel is saying is that you're proposing a new distinction that *does not

Re: A few arrow function specification issues

2012-04-23 Thread David Herman
On Apr 23, 2012, at 2:45 PM, David Herman wrote: You cannot distinguish whether a function was called as a method, as a function, or via .call/.apply. There's no way to tell. PS Well, there's stack inspection, but we're all grownups here. Dave ___

Re: A few arrow function specification issues

2012-04-23 Thread David Herman
On Apr 23, 2012, at 2:44 PM, Brendan Eich wrote: Brendan Eich wrote: Without arguments runtime semantic shifts, and with |this| lexical, there aren't many strict mode changes left IIRC, and they are pretty edgy edge cases. True enough, but I hang tough on wanting arrows to imply

RE: A few arrow function specification issues

2012-04-23 Thread Domenic Denicola
, April 23, 2012 19:11 To: Brendan Eich Cc: es-discuss Subject: Re: A few arrow function specification issues On Apr 23, 2012, at 2:44 PM, Brendan Eich wrote: Brendan Eich wrote: Without arguments runtime semantic shifts, and with |this| lexical, there aren't many strict mode changes left

Re: A few arrow function specification issues

2012-04-23 Thread Anton Kovalyov
...@mozilla.org [mailto:es-discuss- boun...@mozilla.org (mailto:boun...@mozilla.org)] On Behalf Of David Herman Sent: Monday, April 23, 2012 19:11 To: Brendan Eich Cc: es-discuss Subject: Re: A few arrow function specification issues On Apr 23, 2012, at 2:44 PM, Brendan Eich wrote

Re: A few arrow function specification issues

2012-04-23 Thread Brandon Benvie
Strict mode delete non-configurable is one of the only offenders on the this really shouldn't be an error list. The useful functionality no longer allowed list is a couple of key things: caller for debug tracing, and `var` in define. The latter was an issue with Narcissus running in V8 --harmony

Re: A few arrow function specification issues

2012-04-23 Thread Brandon Benvie
`var` in eval I meant (and `const` in Narcissus's case) ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: A few arrow function specification issues

2012-04-23 Thread John J Barton
] On Behalf Of David Herman Sent: Monday, April 23, 2012 19:11 To: Brendan Eich Cc: es-discuss Subject: Re: A few arrow function specification issues On Apr 23, 2012, at 2:44 PM, Brendan Eich wrote: Brendan Eich wrote: Without arguments runtime semantic shifts, and with |this| lexical

Re: A few arrow function specification issues

2012-04-23 Thread Allen Wirfs-Brock
On Apr 23, 2012, at 4:59 PM, Domenic Denicola wrote: As a day-to-day user who was not using strict until recently (stubborn other team member for the loss), I can say that moving to strict was much more a cleanup experience than a mode experience, with only a few small exceptions: 1)

Re: A few arrow function specification issues

2012-04-23 Thread Mark S. Miller
On Mon, Apr 23, 2012 at 5:47 PM, Allen Wirfs-Brock al...@wirfs-brock.comwrote: On Apr 23, 2012, at 4:59 PM, Domenic Denicola wrote: As a day-to-day user who was not using strict until recently (stubborn other team member for the loss), I can say that moving to strict was much more a cleanup

Re: A few arrow function specification issues

2012-04-23 Thread Allen Wirfs-Brock
On Apr 23, 2012, at 6:09 PM, Mark S. Miller wrote: On Mon, Apr 23, 2012 at 5:47 PM, Allen Wirfs-Brock al...@wirfs-brock.com wrote: ... The delete issue is very much along the lines of what I was referring to in another thread[3] today regarding failure oblivious computing. I

Re: A few arrow function specification issues

2012-04-23 Thread Mark S. Miller
On Mon, Apr 23, 2012 at 6:30 PM, Allen Wirfs-Brock al...@wirfs-brock.comwrote: The point is that much of what is done on the web is not high integrity computation. It is essential that high integrity be possible, when it is required. But forcing all computation into the high integrity

Re: A few arrow function specification issues

2012-04-23 Thread John J Barton
+1 High integrity engineering of components supports low integrity integration essential for low cost adaptable systems. We have scripting for the same reason we carpenters. We could build a house using a computer milling machine but no one could afford it; we don't want JavaScript to enforce high

Re: A few arrow function specification issues

2012-04-23 Thread Brandon Benvie
This is why I posited an explicit switch. Right now we're all talking about secondary triggers for a very important component. Why isn't it just an explicit choice? Why can't I install a foot gun where I know I have foot armor plating? The goal being that when my users, without such armor, are

A few arrow function specification issues

2012-04-21 Thread Allen Wirfs-Brock
Here are a few design alternates that have come up as I work the specification draft for arrow functions 1) Always strict? Should all arrow functions be considered strict functions? Pros It's a new syntactic form, so it is it easy to make it be an implicit opt-in to strict mode. We generally

Re: A few arrow function specification issues

2012-04-21 Thread Brendan Eich
Allen Wirfs-Brock wrote: 1) Always strict? Should all arrow functions be considered strict functions? Pros P1. It's a new syntactic form, so it is it easy to make it be an implicit opt-in to strict mode. P2. We generally want to encourage use of strict mode. P3. If not, there would no way to

Re: A few arrow function specification issues

2012-04-21 Thread Angus Croll
4) Should it be a dynamic error to try to use apply/call to set the this binding of an arrow function. Cons To much existing code speculatively binding the this value when invoking a function. I propose that call/apply simply ignore the this value when invoked on an arrow function. What is the

Re: A few arrow function specification issues

2012-04-21 Thread Taka Kojima
I am in agreement with Angus on this one. If there is no skinny arrow, hard |this| binding should not be part of the spec. Fat arrow functions should default to lexical |this|, but if there is no skinny arrow, it should not be a hard binding and call/apply should be allowed, as well as bind, On

RE: A few arrow function specification issues

2012-04-21 Thread Domenic Denicola
-Original Message- From: es-discuss-boun...@mozilla.org [mailto:es-discuss- boun...@mozilla.org] On Behalf Of Angus Croll Sent: Saturday, April 21, 2012 16:03 To: Allen Wirfs-Brock Cc: es-discuss Subject: Re: A few arrow function specification issues 4) Should it be a dynamic

Re: A few arrow function specification issues

2012-04-21 Thread Axel Rauschmayer
I am in agreement with Angus on this one. If there is no skinny arrow, hard |this| binding should not be part of the spec. Fat arrow functions should default to lexical |this|, but if there is no skinny arrow, it should not be a hard binding and call/apply should be allowed, as well as

Re: A few arrow function specification issues

2012-04-21 Thread Taka Kojima
- From: es-discuss-boun...@mozilla.org [mailto:es-discuss- boun...@mozilla.org] On Behalf Of Angus Croll Sent: Saturday, April 21, 2012 16:03 To: Allen Wirfs-Brock Cc: es-discuss Subject: Re: A few arrow function specification issues 4) Should it be a dynamic error to try to use

Re: A few arrow function specification issues

2012-04-21 Thread Angus Croll
a function shouldn’t work radically (and silently!) different depending on how it is invoked every current JS function behaves exactly this way :-) I'm painfully aware that I sound like a broken record on this, but introducing a hard-bound function option while continuing to suport dynamic-bound

Re: A few arrow function specification issues

2012-04-21 Thread Axel Rauschmayer
a function shouldn’t work radically (and silently!) different depending on how it is invoked every current JS function behaves exactly this way :-) `this` when not invoking a function as a method: 1. Bearable: this === undefined 2. Nasty: this === window 3. Very nasty: lexical this I'm

Re: A few arrow function specification issues

2012-04-21 Thread Axel Rauschmayer
On Sat, Apr 21, 2012 at 1:56 PM, Axel Rauschmayer a...@rauschma.de wrote: Counter-question: Isn’t it clear when you create a function whether it is going to be a non-method function or a method? It's clear to the implementer - Its not clear to a function that gets it as an argument -

Re: A few arrow function specification issues

2012-04-21 Thread Brendan Eich
Angus Croll wrote: On Sat, Apr 21, 2012 at 3:06 PM, Axel Rauschmayer a...@rauschma.de mailto:a...@rauschma.de wrote: On Sat, Apr 21, 2012 at 1:56 PM, Axel Rauschmayer a...@rauschma.de mailto:a...@rauschma.de wrote: Counter-question: Isn’t it clear when you create a function

Re: A few arrow function specification issues

2012-04-21 Thread Axel Rauschmayer
I would argue that – in ES.next – whenever a function is passed as an argument, one should always assume that it is a non-method function and completely ignore `this`. This makes me sad. Seems like functions are going to be a little less first class than they were before - and for fairly

Re: A few arrow function specification issues

2012-04-21 Thread Kevin Smith
I understand your argument, but I think it is more important to be able to switch in full to the new function operator(s), not sometimes one, other times the other. Why? Arrow functions and traditional functions serve different semantic purposes. Why is it important to you that we

Re: A few arrow function specification issues

2012-04-21 Thread Axel Rauschmayer
Using `=` but being forced to using `function` anytime I want dynamic this just doesn't work. That may be the crux of the matter. I’d say: In new code, use a method definition any time you want dynamic `this`. In old code, use a function expression. -- Dr. Axel Rauschmayer a...@rauschma.de