On Thu, Jan 27, 2011 at 9:37 PM, Mark S. Miller <[email protected]> wrote:
> I don't understand why single-frame continuations are not at least as
> vulnerable to the criticism you make above. They are even more unproven
> among JavaScript programmers than are the concurrency abstractions in the
> strawman. The main benefit of moving support for single-frame
> continuations into the language is notational, which you dismiss above. I
> don't get it.

We have some experience with single-frame continuations in the Firefox
code base (and elsewhere such as threads.js from Neil Mix), based on
our years-old implementation.  The thing *I* like most about it,
versus working from a callback-based model, is that you can use the
language's flow control constructs.  Having to turn everything inside
out via function chaining hurts a lot, even with helper libraries that
are popular in the node.js community.

for (var i in hash) {
  doSomethingAsyncAndWait();
}

versus gross hackery like breaking out of the enumeration every time
and deleting the just-processed property.  Nothing that code to be
written out of order, or shattered by function decomposition and glued
back together in the programmers mind, will be as satisfying I fear.

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

Reply via email to