Subject: Re: Harmony - proxies | asynchronous
brendan at mozilla.com
Tue Sep 6 13:27:04 PDT 2011
On Sep 6, 2011, at 1:07 PM, Dean Landolt wrote:
> I didn't see this line of reasoning -- I thought your main point was that `generator` was grammatically ambiguous. My apologies if this was so obvious as to be implied, but in any event, it was a trivial little nit begging for a stronger rationale, which was delivered and then some.
No problem. I should number my independent arguments, anyway.
> Yes, I was referring to those sneaky, hidden preemption points where variables change out from under you. This is helped by the * head, but IMHO the deeper problem with libraries like node-fibers that Mikeal was griping about is rooted in a dynamic `wait` call -- preemption that could aliased or buried deep in a call stack. AFAICT generators completely prevent this -- preemption cannot happen without an explicit, static `yield` prefix right at the call site. This is really where "spooky action at a distance" shows up, and to be fair, python and js 1.6 generators are already immune to it.
100% agreed -- the aliasing possibility is particularly bad. We tried to tame eval as a first-class function by making calls via certain kinds of aliases either errors (ES5 strict and up) or indirect evals, but even indirect eval is narsty. No more like this, especially not for a preemption priimitive.
More information about the es-discuss