Short Functions

Brendan Eich brendan at mozilla.com
Mon May 23 16:01:31 PDT 2011


On May 23, 2011, at 2:09 PM, Waldemar Horwat wrote:

> On 05/21/11 23:53, Brendan Eich wrote:
>> That's accurate. But I discounted arrow functions because to be usable, to have the syntax you show above, requires GLR parsing (if bottom up; top-down may be easier, haven't proven it yet).
> 
> GLR parsing would be wild in ECMAScript due to the fact that the lexer is dependent on the parser's current state.  A GLR parser is working on a quantum superposition of multiple states in parallel, so if it encounters a / then some of the superposed states may direct the lexer to interpret it as a division symbol while others direct it to start scanning a regular expression.  So now you need a quantum entanglement of lexers corresponding to the superposed parser states the GLR parser is considering.  Semicolon insertion would also be be forced into quantum entanglement with the superposed parser states.
> 
> Do we really want to go there?

Probably not -- you don't, I will bet a donut! ;-) Hence my discounting of arrow function syntax as a likely-to-succeed strawman, in reply to Bob's hope for it.

/be


More information about the es-discuss mailing list