From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: John Cowan Newsgroups: gmane.lisp.guile.user Subject: Re: Guile fibers return values Date: Mon, 6 Jan 2020 20:36:25 -0500 Message-ID: References: <20200105123329.5019662bdf1895a4164faf62@gmail.com> <20200105142358.4ad96d15a23a0b947b2d55e3@gmail.com> <547672e4-30f7-2783-f3d5-199417a71c98@posteo.de> <20200105214555.60e424b8cf86456e188c75f6@gmail.com> <7661b27f-787e-fc8f-d653-5fbabffa01f7@posteo.de> <20200106211456.68c8a637631a4e1e977d8443@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="114546"; mail-complaints-to="usenet@blaine.gmane.org" Cc: Guile User To: Zelphir Kaltstahl Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue Jan 07 02:37:47 2020 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iodoZ-000Tft-Cc for guile-user@m.gmane.org; Tue, 07 Jan 2020 02:37:47 +0100 Original-Received: from localhost ([::1]:36600 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iodoX-0002uk-4B for guile-user@m.gmane.org; Mon, 06 Jan 2020 20:37:45 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48872) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iodnU-0002ol-74 for guile-user@gnu.org; Mon, 06 Jan 2020 20:36:41 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iodnS-0005Rx-Ao for guile-user@gnu.org; Mon, 06 Jan 2020 20:36:39 -0500 Original-Received: from mail-qk1-x72b.google.com ([2607:f8b0:4864:20::72b]:38575) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iodnR-0005Lp-UL for guile-user@gnu.org; Mon, 06 Jan 2020 20:36:38 -0500 Original-Received: by mail-qk1-x72b.google.com with SMTP id k6so41324888qki.5 for ; Mon, 06 Jan 2020 17:36:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ccil-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=o7nxD1X84R9+CMjt+zFKWxaWuk/3gxp87dX3vzEv4wU=; b=MQ0Fz0SDxUE6aPUpVcsM+dRZLrRM+9tvKE6a6zhU2f0BrfHnHXneuQUB8zWTUXMOhT h1QRFwWfPwD2Q704rgs3Z8XKcKoDisEK8yU/Wxq81I4FBuBOjY68QrrG7EZYVlo2Qaaz hQIYXxlHqobEin9wuVp+CCea3mJPz+I78z6o8NoDMp4gbWN53W8pwNOGGb3kwQURw4sU +UHRLXBME6TXdyx0KPeTK0hEgQL+LzdooBX65qghrORl1ksATFqyUzpKehSMsAMrap82 ke41/Efu00gWLbyGtcAfrsUuYGnZnQE2TeU6ecHpDOucMEz1RF9Aqj9BJnZ3k87XfBkm OSIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=o7nxD1X84R9+CMjt+zFKWxaWuk/3gxp87dX3vzEv4wU=; b=KvtTTNreS3tp50Gj+4Q74+hTnfrZMxdX0C90v6Q2RemEYjDPJybBsGFJBR9m5/Yewc Xr1g/RxvUn4uGOHovvbNou+dZORhPJMrK57csxZs1oYgHvfbEV7Nh43ja8vvgX8R5r94 IrfMRlAGXCwzj2xMs4NCtnn0qaR+duzD1+h5cTJOQBWNjhNcmwPGqrP5ung4lNZKWWq0 7DCEE8zU74k0Fzcq1o1ABAjjDtyxYIgTDuwcPPtlqrEOzW2CCHNS5ZPf93oT0hFmsYQ2 mhRGyYCYueMSEcTrb9iYqLlJTDzJn/2o7NAKdr5q4DTXrITmZRp02kSPdaDLJ+I/iyHP j+rQ== X-Gm-Message-State: APjAAAVXeeRrS6KyPv+5r1tWFfm1ttExDZJPpgbuzBGWP3mAstUVIF0h WjnKZ8gjsq4hUs02/mBGfztqEd/buFJCw88xmWYQ9Q== X-Google-Smtp-Source: APXvYqxSLLk2Zy+ZmETG4y8iMEoH+mWbErZKsBj3sJOfAI4nd7VDus+mywXsVv1+Har6vPIRVwaU831ED+qXLBSdIpQ= X-Received: by 2002:a05:620a:12c4:: with SMTP id e4mr86983745qkl.359.1578360995829; Mon, 06 Jan 2020 17:36:35 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Received-From: 2607:f8b0:4864:20::72b X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:16004 Archived-At: On Mon, Jan 6, 2020 at 5:45 PM Zelphir Kaltstahl 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