3 ms·
What is the precise definition of a "promise"? I.e., what is the interface of a promise?
by ProfHewitt 7y ago
What is the precise definition of a "promise"?
I.e., what is the interface of a promise?
- lidHanteyk 7y agoMonte is based on E, so they are using E-style promises. An example of ActorScript in Monte is at [0]. There are two main operations that can be done with a promise. We can wait for it to complete, and then perform another action when it is complete, known as "when-blocks"; we can also send a message on top of another sent message, informally known as "promise pipelining". When-blocks: when (action) -> { doMoreStuff() } Promise pipelining: promise<-add(4)<-subtract(3) [0] https://groups.google.com/forum/#!topic/cap-talk/y1bEqOoeswE https://groups.google.com/forum/#!topic/cap-talk/y1bEqOoeswE
- ProfHewitt 7y agoPromises are used most prominently in current-generation JavaScript where they lack a proper interface. Instead promises are standardized using language constructs. Promises have the well-known disadvantage that promises are contagious, i.e, once a promise is used then everything that continues must be promises. On the other hand, a Future [Baker and Hewitt 1977] has the following well defined interface: Future<t> *interface* resolve[] ↦ t