From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Jack Kamm <jackkamm@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Asynchronous session evaluation
Date: Sat, 17 Aug 2019 15:37:02 +0200 [thread overview]
Message-ID: <87ef1j52wx.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <87muj04xim.fsf@jaheira.i-did-not-set--mail-host-address--so-tickle-me> (Jack Kamm's message of "Sat, 01 Jun 2019 17:54:41 -0700")
Hello,
Jack Kamm <jackkamm@gmail.com> writes:
> For some time I've been wishing for asynchronous Babel session
> evaluation. So I've created an experimental branch implementing this. I
> have an initial version working for R, so I thought it'd be a good time
> to seek feedback and gauge interest.
>
> To test the attached patch, add ":async yes" to an R session block
> with a long computation (or "System.sleep") in it. Upon evaluation,
> your Emacs won't freeze to wait for the result -- instead, a
> placeholder will be inserted, and replaced with the true result when
> it's ready.
>
> I'll note how this is different from some related projects. ob-async
> implements asynchronous evaluation for Babel, but it doesn't work with
> sessions. emacs-jupyter, ein, and ob-ipython all implement asynchronous
> session evaluation, but only for Jupyter kernels. Jupyter is great for
> some cases, but sometimes I'd prefer not to use it. For example, the
> native R console has great Emacs support via ESS, whereas the Jupyter R
> console doesn't work with ESS and is not widely used in the R community.
>
> Note that if you use ob-async, make sure to add "R" to
> `ob-async-no-async-languages-alist' before testing this.
>
> The new functionality is mainly implemented in
> `org-babel-comint-async-filter', which I've defined in ob-comint.el,
> and added as a hook to `comint-output-filter-functions'. Whenever new
> output is added to the comint buffer, the filter scans for an
> indicator token (this is inspired by
> `org-babel-comint-with-output'). Upon encountering the token, the
> filter uses a regular expression to extract a UUID or temp-file
> associated with the result, then searches for the appropriate location
> to add the result to.
>
> I've tried to make behavior as similar as possible to existing
> ob-comint behavior, so that some of the existing code for interacting
> with ob-comint can be refactored and reused. Still, it will be a large
> task to add this feature for all languages. So far, I've only done R,
> but my thought is to implement a few more languages before nailing
> down the functionality. But, I hope something like this could be
> merged in supporting just a subset of languages initially, then
> gradually increasing the number of supported languages over time.
This sound interesting. I hope this is not going to bit-rot while we're
waiting for feedback.
If you think this is stable enough, however, you could simply integrate
in the master branch after Org 9.3 release. It would require an entry in
ORG-NEWS, though.
WDYT?
Regards,
--
Nicolas Goaziou
next prev parent reply other threads:[~2019-08-17 13:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-02 0:54 Asynchronous session evaluation Jack Kamm
2019-08-17 13:37 ` Nicolas Goaziou [this message]
2019-08-17 23:00 ` Jack Kamm
2019-08-24 15:49 ` Jack Kamm
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.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ef1j52wx.fsf@nicolasgoaziou.fr \
--to=mail@nicolasgoaziou.fr \
--cc=emacs-orgmode@gnu.org \
--cc=jackkamm@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 public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
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).