On Fri, Oct 21, 2011 at 9:41 AM, Brendan Eich <[email protected]> wrote:

> On Oct 21, 2011, at 9:34 AM, John J Barton wrote:
>
> Can anyone summarize how these proposals relate to Kris Kowal / Kris Zyp /
> Mark Miller Q library:
> https://github.com/kriskowal/q
>
>
> Did you see
> https://github.com/kriskowal/q/tree/master/examples/async-generators yet?
>

Thanks, I think that page clarifies my issue with generators: they solve a
problem I don't have. See below.


>
>
> In my experience, reasoning about the code was much easier with Q than
> without Q.  (Not something I found in trying generators).
>
>
> In order to say something that isn't subjective yet content-free other than
> negative, what was hard to reason about, and why? Can you give three
> examples?
>

I only mentioned generators since Zyp's proposal uses yield. Now I'm
regretting it because I really wanted to highlight Q.

My comment is entirely subjective and intended to be positive about Q.

The examples on the async-generators page cites above are clearer than the
ones on the MDC generators page because they focus on "next()". The strong
case for generators is support for generic, encapsulated iteration. Examples
illustrating this power would go a long way to build the case for them IMO.
Examples of quirky iteration do not.

Now back to Zyp's key point: using async functionality for iteration,
powerful or not, does not address the key use-case for async.

In particular, Q simplifies joining parallel async operations (XHR,
postMessages, 'load', 'progress' events). Of course it may well be that
generators provide an elegant solution to this important problem, but I've
not seen such examples.

jjb
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to