all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Augusto Stoffel <arstoffel@gmail.com>
To: Philip Kaludercic <philipk@posteo.net>
Cc: emacs-devel@gnu.org
Subject: Re: ELPA submission: drepl (REPL protocol)
Date: Wed, 01 Nov 2023 19:56:42 +0100	[thread overview]
Message-ID: <87il6l9uad.fsf@gmail.com> (raw)
In-Reply-To: <87edh9z5d1.fsf@posteo.net> (Philip Kaludercic's message of "Wed,  01 Nov 2023 18:38:18 +0000")

On Wed,  1 Nov 2023 at 18:38, Philip Kaludercic wrote:

> Augusto Stoffel <arstoffel@gmail.com> writes:
>
>> On Tue, 31 Oct 2023 at 09:08, Philip Kaludercic wrote:
>>
>>> The idea seems interesting, I'll have to try it out at some point
>>> (though I don't really use Python or Lua much, so I hope you plan to add
>>> more languages in the future).
>
>> Sure, let me know if you have any ideas.  A good candidate, as I
>> mention in the readme, would be a language that has a good embeddable
>> REPL library that you hack into (as opposed to a program where the
>> REP-loop is more or less hardcoded).
>
> What does a REPL library need, that most languages couldn't implement
> themselves if they have an eval function?

Yes, this is all you need to define a Comint.  But if you want
e.g. completions, then a _function_ that computes the completions of
given a prefix is helpful.

Contrast this with bash: it has a completion system, but, AFAIK, that
can be accessed only through readline.  It's not impossible, in Comint,
to send a TAB character, block until you detect a prompt, and try to
parse the text printed in the meanwhile (purportedly the completion
candidates).  But experience seems to show this is very hard to get
right.

The idea here is to avoid this kind of chicanery (and pursue a different
kind of chicanery).  If I succeeded in my design, then any embeddable
REPL library, including niceties such as a function that completes a
list of completions from a given piece of text, should be fairly easy to
plug into.

>>>  (cl-defgeneric drepl--command (repl)
>>>    "The command to start the REPL interpreter as a list of strings."
>>>    (ignore repl)
>>> -  (error "This needs an implementation"))
>>> +  (error "This needs an implementation")) ;Mention what "this" is
>>
>> _This_ is the method.  This is one of the two things that cannot have a
>> default implementation and should be implemented by every subclass :-).
>> Is the message confusing?
>
> I am just imagining an error message appearing in the mini buffer saying
> "This needs an implementation", without an indication where the error is
> coming from.

Yep, it's a message for the REPL implementor, not the user... I'll
rephrase a bit.



  reply	other threads:[~2023-11-01 18:56 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-30  7:18 ELPA submission: drepl (REPL protocol) Augusto Stoffel
2023-10-30 22:33 ` Stefan Kangas
2023-10-31  8:11   ` Augusto Stoffel
2023-11-01 20:18     ` Stefan Kangas
2023-10-31  9:08 ` Philip Kaludercic
2023-11-01 18:28   ` Augusto Stoffel
2023-11-01 18:38     ` Philip Kaludercic
2023-11-01 18:56       ` Augusto Stoffel [this message]
2023-11-02 14:26       ` João Távora
2023-11-02 16:08         ` Augusto Stoffel
2023-11-02 16:16           ` João Távora
2023-11-01 18:36   ` Augusto Stoffel
2023-11-07  8:20   ` Philip Kaludercic
2023-11-07 16:52     ` Augusto Stoffel

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=87il6l9uad.fsf@gmail.com \
    --to=arstoffel@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=philipk@posteo.net \
    /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.