[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Is there any easy way to fork in elisp? Why not?
From: |
Stefan Monnier |
Subject: |
Re: Is there any easy way to fork in elisp? Why not? |
Date: |
Thu, 28 Oct 2021 18:06:03 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
> If the server could just fork, eval the request, return it, and die,
> everything would be easy and painless.
>
> The fork API could be:
> ```
> (let-fork ((some_val (expensive_compute)) ...)
> (lambda()
> (message "Computed: %s" some_val)))
> ```
We should indeed add such support in core. Currently the `async`
package offers such functionality, but I think this belongs in core.
More generally a kind of "Emacs batch server" will be useful.
Something similar to the server.el but whose purpose would be to launch
independent/fresh batch Emacs sessions efficiently.
A long time ago I suggested to add support for the `fork`
POSIX primitive which could be ideal for that, but AFAIK it's hard to
provide such a functionality in w32, so we'd want the Lisp-level API not
to be tied to the semantics of POSIX `fork`.
Stefan