arrow function syntax simplified
Claus Reinke
claus.reinke at talk21.com
Thu Apr 5 09:13:19 PDT 2012
>> Your point about synthesizing dynamic-|this| given lexical-|this| forms
>> is good. It seems to me having fn, rec, and => is therefore best. What
>> am I missing?
>
> That is my current state of thinking, too.
Until I started thinking about performance:-( With current
implementations, at least, using rec is impractical: not just
slow but "too much" recursion. Which raises some questions:
- what is the state of play/plans wrt implementing tail-call
optimization?
- what are the chances of JS implementations optimizing
the overhead of fn and rec away? Overheads include
- call-by-value requires eta-expansion (wrapping the
recursive term to avoid runaway evaluation)
- preference of multi-parameter lists over nested single
parameters leads to use of apply/slice/concat
It is sad to see a language design question decided by
implementation limitations, but until the questions above
receive good answers (or someone comes up with better
combinators;-), my proposed scheme is not practical.
Claus
More information about the es-discuss
mailing list