emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

async-await (was: Re: "Asynchronous Requests from Emacs Dynamic Modules"


From: Philipp Stephani
Subject: async-await (was: Re: "Asynchronous Requests from Emacs Dynamic Modules")
Date: Sun, 1 Nov 2020 21:51:53 +0100

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 via email to

[Prev in Thread] Current Thread [Next in Thread]