unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: John Cowan <cowan@ccil.org>
To: Zelphir Kaltstahl <zelphirkaltstahl@posteo.de>
Cc: Guile User <guile-user@gnu.org>
Subject: Re: Guile fibers return values
Date: Mon, 6 Jan 2020 20:36:25 -0500	[thread overview]
Message-ID: <CAD2gp_TTyz=RgemLRe=Y3bcsULSQEVYfZT8y4QZRjvo+Js13zg@mail.gmail.com> (raw)
In-Reply-To: <d3533796-671f-246c-327a-41b029a06529@posteo.de>

On Mon, Jan 6, 2020 at 5:45 PM Zelphir Kaltstahl <zelphirkaltstahl@posteo.de>
wrote:

I think that is a typo maybe? The futures guide says:
>
> "The (ice-9 futures) module provides futures, a construct for fine-grain
> parallelism."
>

I know, and I think that's an error (or rather a confusing point) in the
docs.  It should say "for fine-grained concurrency".


> Or do you say this,
> because on a single core machine, there would be no parallelism and thus
> one cannot say, that Guile's futures will enable parallelism in general,
> but can say, that they in general enable concurrency?
>

Just so.


> I think of "promises" as something that enables asynchronous execution.
>

Scheme promises are described in R7RS 4.2.5.  They are basically just
memoized closures.  When you create one it sits there until you force it
and then the closure is invoked and you get a result.  If you force it
again, you just get the result without any invocation.

So you can think of this as a degenerate Guile future / Racket thread that
doesn't even start until it is touched (by forcing it), or as a degenerate
Racket future / Guile parallel construct that tries to run in parallel but
is immediately unable to do so, so it has to wait until it is touched (also
by forcing it).  But promises don't provide you with either concurrency or
parallelism in themselves, so they are only useful to help with
understanding.

Don't beat me for this: "Just like in JavaScript" basically :D
>

JS promises, I think, are futures.
https://en.wikipedia.org/wiki/Futures_and_promises shows just how confusing
the terminology is.



John Cowan          http://vrici.lojban.org/~cowan        cowan@ccil.org
Fundamental thinking is ha-ard.  Let's go ideology-shopping.
                        --Philosopher Barbie


  reply	other threads:[~2020-01-07  1:36 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-05  1:30 Guile fibers return values Zelphir Kaltstahl
2020-01-05 12:33 ` Chris Vine
2020-01-05 12:58   ` Zelphir Kaltstahl
2020-01-05 14:28     ` Chris Vine
     [not found]     ` <20200105142358.4ad96d15a23a0b947b2d55e3@gmail.com>
2020-01-05 18:22       ` Zelphir Kaltstahl
2020-01-05 21:45         ` Chris Vine
2020-01-06 19:42           ` Zelphir Kaltstahl
2020-01-06 21:14             ` Chris Vine
2020-01-06 21:47               ` John Cowan
2020-01-06 22:45                 ` Zelphir Kaltstahl
2020-01-07  1:36                   ` John Cowan [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-01-04 22:49 Zelphir Kaltstahl
2020-01-05  2:42 ` John Cowan
2020-01-05 12:46   ` Zelphir Kaltstahl
2020-01-14 10:59 ` Amirouche Boubekki
2020-01-15  0:04   ` Zelphir Kaltstahl

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

  List information: https://www.gnu.org/software/guile/

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

  git send-email \
    --in-reply-to='CAD2gp_TTyz=RgemLRe=Y3bcsULSQEVYfZT8y4QZRjvo+Js13zg@mail.gmail.com' \
    --to=cowan@ccil.org \
    --cc=guile-user@gnu.org \
    --cc=zelphirkaltstahl@posteo.de \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).