[Top][All Lists]

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

Re: continuation passing in Emacs vs. JUST-THIS-ONE

From: Eli Zaretskii
Subject: Re: continuation passing in Emacs vs. JUST-THIS-ONE
Date: Tue, 18 Apr 2023 05:25:07 +0300

> From: Tomas Hlavaty <tom@logand.com>
> Cc: monnier@iro.umontreal.ca, jporterbugs@gmail.com,
>       karthikchikmagalur@gmail.com, emacs-devel@gnu.org
> Date: Mon, 17 Apr 2023 22:51:22 +0200
> On Wed 12 Apr 2023 at 09:13, Eli Zaretskii <eliz@gnu.org> wrote:
> > Async subprocesses are currently the only feature in Emacs that
> > provides an opportunity for writing asynchronous code.
> Do you not consider, for example, using implementations of async/await
> using promisses and CPS rewriting "writing asynchronous code"?
> Do you not consider, for example, doing the same using callbacks as
> "writing asynchronous code"?

Not necessarily.

> >> I do not know how useable threads in Emacs are at the moment,
> >> but they are already there and the examples I tried worked well.
> >
> > If you think Lisp threads in Emacs allow asynchronous processing, you
> > are mistaken: they don't.  Only one such thread can be running at any
> > given time.
> The examples I wrote worked fine with threads.  The examples did not
> require parallelism.  I do not think that what you suggest disqualifies
> threads for "writing asynchronous code".
> It would be great to have better thread implementation, but that does
> not seem to have anything to do with "writing asynchronous code".
> Here is what I understand under synchronous code:
>    (plus 1 2)
>    returns 3 immediatelly
> Here is what I understand under asynchronous code:
>    (plus 1 2)
>    returns something immediately
>    and then some time later 3 appers in the *Message* buffer, for
>    example
> How that is achieved is an implementation (possibly leaky) detail.

In my book, asynchronous means parallel processing, not just delayed

reply via email to

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