all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Philipp Stephani <p.stephani2@gmail.com>
To: Akira Kyle <ak@akirakyle.com>
Cc: Eli Zaretskii <eliz@gnu.org>,
	Emacs developers <emacs-devel@gnu.org>,
	yyoncho <yyoncho@gmail.com>,
	Stefan Monnier <monnier@iro.umontreal.ca>,
	all_but_last@163.com
Subject: async-await (was: Re: "Asynchronous Requests from Emacs Dynamic Modules")
Date: Sun, 1 Nov 2020 21:51:53 +0100	[thread overview]
Message-ID: <CAArVCkR1UsUW7dDw4qcBYVjK_gLGAoEewTRVfhmLRuna85b3Lw@mail.gmail.com> (raw)
In-Reply-To: <86a6w0omts.fsf@akirakyle.com>

Am So., 1. Nov. 2020 um 21:15 Uhr schrieb Akira Kyle <ak@akirakyle.com>:

> I think libraries like emacs-aio [1] accomplish the same thing but
> with a much easier to use interface. By using (run-at-time 0 nil
> callback args) they accomplish a sort of "green threading" that
> doesn't actually need any sort of pthread support or the
> associated issues with ensuring atomicity with the interpreter. It
> would be great to have something like this built in.
>
> [1] https://github.com/skeeto/emacs-aio

I agree (independent of the threading interface and module question)
that an async-await model is really nice and powerful. It would indeed
be great to better support it in Emacs.
The aio library suffers from a few problems (due to Emacs, not due to
the library itself), which could be rectified by implementing such
support in core Emacs:
1. It makes functions virtually un-debuggable because of the necessary
CPS transformations. Either Edebug should be beefed up to understand
the CPS state machines, or the state machine generation should somehow
happen in core.
2. It makes error reporting from asynchronous functions virtually
impossible because the timer machinery catches all errors and converts
them into nondescript "error in timer" messages.
None of those are impossible to overcome, but they need a bit of
design work to fix.



  reply	other threads:[~2020-11-01 20:51 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-30 21:35 "Asynchronous Requests from Emacs Dynamic Modules" Akira Kyle
2020-10-30 22:39 ` Stefan Monnier
2020-10-31  3:18 ` Zhu Zihao
2020-10-31  7:45   ` Eli Zaretskii
2020-10-31  8:02     ` yyoncho
2020-10-31  9:13       ` Eli Zaretskii
2020-10-31  9:45         ` yyoncho
2020-10-31 10:43           ` Eli Zaretskii
2020-10-31 19:25             ` Akira Kyle
2020-10-31 20:18               ` Eli Zaretskii
2020-11-01  0:14                 ` Akira Kyle
2020-11-01 18:28                   ` Eli Zaretskii
2020-11-01 20:15                     ` Akira Kyle
2020-11-01 20:51                       ` Philipp Stephani [this message]
2020-11-02 15:22                       ` Eli Zaretskii
2020-10-31  7:36 ` Philipp Stephani
2020-10-31 12:49   ` Stefan Monnier
2020-11-01 20:18     ` Akira Kyle
2020-11-01 20:32       ` Philipp Stephani
2020-11-20 15:54     ` Zhu Zihao
2020-11-20 16:04       ` Robert Pluim

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=CAArVCkR1UsUW7dDw4qcBYVjK_gLGAoEewTRVfhmLRuna85b3Lw@mail.gmail.com \
    --to=p.stephani2@gmail.com \
    --cc=ak@akirakyle.com \
    --cc=all_but_last@163.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=yyoncho@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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.