More flexibility in the ECMAScript part? (was: Re: Futures

Kevin Smith zenparsing at gmail.com
Thu Apr 18 07:45:19 PDT 2013


>
> Note that Futures are entirely expressible in today's JS semantics.
>
>
Even setting aside the event loop, this is arguable.  Futures *as
implemented in libraries today* are expressible, sure.  That's a tautology.
 But there are cross-cutting issues at play, as Allen explained.

In the case of Futures, there's that strange little method named `done`.
 The `done` method has always been conceived as a stop-gap solution for
making "unhandled" rejections visible to the programmer.  The usability of
`done` is, well, not so great.

It's quite clear that the garbage collector provides us with an upper bound
on how long we must wait to know that a rejected future is truly unhandled.
 When the future is collected, then obviously no additional error handlers
can be assigned to it.

WeakRefs would give us just the information we need, but no consensus has
been reached on them yet.  Does it make sense to move forward with `done`
when WeakRefs are sitting on the horizon?  I don't have the answer, but
these are the kind of cross-cutting issues that need to be carefully
considered.  Preferably on es-discuss.  : )

{ Kevin }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130418/67275ae8/attachment.html>


More information about the es-discuss mailing list