The Paradox of Partial Parametricity

Tom Van Cutsem tomvc.be at gmail.com
Mon May 27 06:30:16 PDT 2013


2013/5/26 Brendan Eich <brendan at mozilla.com>

> Russell Leggett wrote:
>
>> I'm sorry if I have just missed it trying to keep up to date, but what
>> are the compelling use cases.
>>
>
> AsyncTable with promises as values.
>

What the discussion at last week's TC39 meeting clarified for me is the
following:

- Promises are primarily a control-flow abstraction.
- Sometimes, they are also used as a data-abstraction (i.e. as a container
in their own right, wrapping an arbitrary payload).
- All of the subtle problems discussed in these threads only start to arise
when these two use cases of promises are being mixed, e.g. a
promise-as-data-container being mistaken for a
promise-as-control-abstraction. This rarely happens in application code,
but may happen in generic library code.

The AsyncTable is one example of such generic library code that uses both
promises-as-data and promises-for-control.

Personally, after 6 years of programming with futures/promises, I have
almost never used promises-as-data. I use them exclusively for control. I
suspect most proponents of the Q-style of using promises share that
experience.

Cheers,
Tom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130527/a9e7409f/attachment.html>


More information about the es-discuss mailing list