unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Christopher Allan Webber <cwebber@dustycloud.org>
To: Amirouche Boubekki <amirouche@hypermove.net>
Cc: guile-devel-bounces+amirouche+dev=hypermove.net@gnu.org,
	guile-devel@gnu.org
Subject: Re: Asynchronous event loop brainstorm at FSF 30
Date: Sun, 04 Oct 2015 10:19:03 -0500	[thread overview]
Message-ID: <87eghau05r.fsf@dustycloud.org> (raw)
In-Reply-To: <6256857ed9f289c87b0deafd17bc8eb9@hypermove.net>

Amirouche Boubekki writes:

> Héllo,
>
> Please excuse my layman question in advance.
>
> I find the idea awesome to work on asynchronous framework for Guile.
>
> Le 2015-10-04 00:29, Christopher Allan Webber a écrit:
>> So David Thompson, Mark Weaver, Andrew Engelbrecht and I sat down to
>> talk over how we might go about an asynchronous event loop in Guile 
>> that
>> might be fairly extensible.  Here are some of what we discussed, in
>> bullet points:
>> 
>>  - General idea is to do something coroutine based.
>
> IUC coroutine takes advantage of the ability to pause the execution of 
> given procedure A to run a blocking operation B and execute some other 
> procedure C while the blocking operation B is running. At some point, 
> when the blocking operation B is finished, and C is finished, A restarts 
> where it left.

Sort of, I'm not sure that "blocking" needs to be tossed in there.
We're interested in as much nonblocking behavior as possible.

Coroutines in this case basically means functions that can be suspended
and then woken up again when whatever asynchronous code they rely on has
completed (possibly receiving a value from that as well).

>>  - This would be like asyncio or node.js, asynchronous but *not* OS
>>    thread based (it's too much work to make much of Guile fit around
>>    that for now)
>> 
>>  - If you really need to maximize your multiple cores, you can do
>>    multiple processes with message passing anyway
>
> Does it mean that there will be one event loop per thread per process ?

Yes.

>> 
>>  - So what we really need is a nice API for how to do coroutines, write
>>    asynchronous code, and work with some event loop with a scheduler
>
>
>>  - Probably a good way to start on this would be to use libuv (or is it
>>    libev?) and prototype this.  It's not clear if that's a good long
>>    term approach (eg, I think it doesn't work on the HURD for those who
>>    care about that, and Guix certainly does)
>
> In asyncio the event loop can be swapped the default event loop is pure 
> python. You mean that the first version will use libuv (libuv is the 
> nodejs eventloop, formely based on libev).

Right, I think that modeling the event loop in an abstract way is a
strong idea.  One nice feature is that the asyncio event loop can be
swapped out... thus, it's possible to use the default event loop, a GTK
event loop, or twisted, or whatever, IIRC

>>  - Binary/custom ports could be a nice means of abstraction for this
>> 
>> So, that's our thoughts, maybe someone or one of us or maybe even *you*
>> will be inspired to start from here?
>> 
>
> I don't want to make promises (pun on punpose) but I find this proposal 
> really interesting.

Great!  And good pun :)



  reply	other threads:[~2015-10-04 15:19 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-03 22:29 Asynchronous event loop brainstorm at FSF 30 Christopher Allan Webber
2015-10-04 13:24 ` Amirouche Boubekki
2015-10-04 15:19   ` Christopher Allan Webber [this message]
2015-10-04 15:24 ` Christopher Allan Webber
2015-10-04 15:58 ` Nala Ginrut
2015-10-04 16:15 ` Chris Vine
2015-11-17 17:46   ` Christopher Allan Webber
2015-11-18 10:26     ` Chris Vine
2015-11-18 14:37       ` Christopher Allan Webber
2015-11-19 13:27       ` Chris Vine
2015-11-18 12:44 ` Mikael Djurfeldt
2015-11-18 14:16   ` Christopher Allan Webber
2015-11-18 16:36     ` Mikael Djurfeldt

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=87eghau05r.fsf@dustycloud.org \
    --to=cwebber@dustycloud.org \
    --cc=amirouche@hypermove.net \
    --cc=guile-devel-bounces+amirouche+dev=hypermove.net@gnu.org \
    --cc=guile-devel@gnu.org \
    /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).