Mark S. Miller (2013-11-13T00:22:49.000Z)
domenic at domenicdenicola.com (2013-11-17T18:00:18.346Z)
I mean the promises-unwrapping proposal that has now been accepted into ES6 and the DOM, and IIUC is being implemented by several browser makers. Let's call these JS Promises. These descend from Promises/A+ which have a long and complicated history, but the major branches of that history all to back to E. Approximately: ``` JS Promises from Promises/A+ from merge(Promises/A, Q) Promises/A from Dojo Deferred from MochiKit Deferred from Twisted Python Deferred from E Promises. Q from Promises/C from Waterken Q from E Promises ``` My point is that the differences between hard references and JS Promises are exactly the non-transparencies needed to address your non-Stonebreaker bullets: > * One cannot ignore network latency and partitioning. Latency: JS Promises are asynchronous and were carefully designed to not preclude future promise pipelining. Q makes use of this pipelining. Partition: JS Promises have a terminal "rejected" state indicating that they will never designate any object. This descends directly from the E "broken" state, where it was was also used to make network partition apparent in a fail-stop manner. Q makes use of this. > * Sync RPC is the wrong model (it already yielded to async calls, futures/promises, and the like). Exactly! > * Weak consistency (I know, people hear "CAP" and give up too much) won, which surprised some. Because Promises are asynchronous, even locally, the state of the world when a promise-based request is made differs from the one in which the request is received. Since partition induces rejection of all promises across that partition, connection recovery takes distinct paths through the code where one copes, in an application dependent manner, with having been out of communication. Further support for weak consistency should come at a higher level, e.g., via the [Unum model](https://www.cypherpunks.to/erights/talks/uni-tea/uni-tea.ppt). Promises are a good substrate on which to build Una.