caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Andreas Rossberg <rossberg@mpi-sws.org>
To: Malcolm Matalka <mmatalka@gmail.com>
Cc: Anton Bachin <antronbachin@gmail.com>,
	Ivan Gotovchits <ivg@ieee.org>,
	"caml-list@inria.fr users" <caml-list@inria.fr>
Subject: Re: [Caml-list] [ANN] Lwt 2.7.0 – monadic promises; concurrent I/O
Date: Mon, 9 Jan 2017 18:04:12 +0100	[thread overview]
Message-ID: <DF6910B8-8265-46D8-89F3-58D0273B5C1A@mpi-sws.org> (raw)
In-Reply-To: <8637gvdtpj.fsf@gmail.com>

> On Jan 7, 2017, at 11:56 , Malcolm Matalka <mmatalka@gmail.com> wrote:
> 
> To add some more terminology to the mix, I have generally seen Future
> and Promise being two sides of the same thing.  A Future is a read-only
> value that can be determined to a value and a Promise is the side that
> can be set.  The wikipedia entry uses this terminology.
> 
> https://en.wikipedia.org/wiki/Futures_and_promises

The history of the future/promise terminology is somewhat confusing. Friedman & Wise introduced the concept as promises, Baker & Hewitt (re)named it futures (there are only superficial differences). They gained wider popularity with Multilisp, which also called them futures. As far as the functional language space is concerned, that term pretty much stuck. In the imperative/OO space, the term promise became somewhat popular with Liskov & Shrira and their promise pipelining. However, most contemporary mainstream languages (C++, Java, ...) also use future.

As far as I am aware, Alice ML was the first language that had _both_ futures and promises and factorised them in the way you cite, where promises are essentially single assignment variables — at least I remember that we iterated on various terminologies for a long time around 99/00 until we settled on this. I don’t know how the future/promise API in C++ came about, but it arrived at a very similar distinction. So did Scala. All these languages characterise promises by the presence of a resolve/‘fulfill' operator.

There is a different distinction being made by e.g. Mark Miller, who characterises futures by a (synchronous, blocking) read operation, and promises by a (asynchronous, nonblocking) bind operator taking a callback. Personally, I find this use of terminology rather unintuitive and problematic, since there is no reason that a blocking future cannot also have a non-blocking bind method (and they often do). But it is the reason that JavaScript calls its notion promise (although there was discussion about that). Arguably, though, it is the odd one out as far as both mainstream and functional languages are concerned.

(More generally, I would not recommend using JavaScript as precedent for anything regarding its promises, since they are broken in just about every possible way. And I’m saying that as a member of the committee that standardised them… :) )

/Andreas


  reply	other threads:[~2017-01-09 17:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-06 16:08 Anton Bachin
2017-01-06 18:00 ` Ivan Gotovchits
2017-01-06 18:12   ` Ivan Gotovchits
2017-01-06 18:39     ` Xavier Van de Woestyne
2017-01-06 19:41   ` Anton Bachin
2017-01-06 20:36     ` Ivan Gotovchits
2017-01-07 10:56     ` Malcolm Matalka
2017-01-09 17:04       ` Andreas Rossberg [this message]
2017-01-11  8:57         ` Michael Grünewald

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DF6910B8-8265-46D8-89F3-58D0273B5C1A@mpi-sws.org \
    --to=rossberg@mpi-sws.org \
    --cc=antronbachin@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=ivg@ieee.org \
    --cc=mmatalka@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).