From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Augusto Stoffel Newsgroups: gmane.emacs.devel Subject: Re: ELPA submission: drepl (REPL protocol) Date: Wed, 01 Nov 2023 19:56:42 +0100 Message-ID: <87il6l9uad.fsf@gmail.com> References: <87wmv4bmtx.fsf@gmail.com> <874ji7w44p.fsf@posteo.net> <87sf5p9vkm.fsf@gmail.com> <87edh9z5d1.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16265"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: emacs-devel@gnu.org To: Philip Kaludercic Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Nov 01 19:57:40 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qyGPL-00042I-UU for ged-emacs-devel@m.gmane-mx.org; Wed, 01 Nov 2023 19:57:39 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qyGOZ-0000VG-C1; Wed, 01 Nov 2023 14:56:51 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qyGOX-0000V8-Fn for emacs-devel@gnu.org; Wed, 01 Nov 2023 14:56:49 -0400 Original-Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyGOW-0003yh-00 for emacs-devel@gnu.org; Wed, 01 Nov 2023 14:56:49 -0400 Original-Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-53db360294fso148285a12.3 for ; Wed, 01 Nov 2023 11:56:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698865005; x=1699469805; darn=gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=zXRHDnxXkEqaAnbIT/Sul4gGiiSBYwZFD1nHBP8t8J8=; b=LPFvEu0qdPMZJK7cibxOfxcBYe47Hyp3G1MkuvlsYhTqyAD5aE5L7jYblUqHjvYesw xdszk7s0mgQJYkfORp2L3jBDmsi9PiWddstYTtoXxTwMOTySUfU6Gg3KOexEgkOOs0MJ 6+AwR0NT20WydopRAagZd+jdvZfKj+h1rzxE+EKCS7hpFdxWkVEm1gGpf5ECJQm9liDS ff9k5XoJVhJH5bkXyt5cvLghBKeIQ8OwLzKGbxkeezRAJPiJd0M8dj581jVu6dGcj8BQ ZPN0hKbc+wdZJyrIVmjoGO0cOt4DG5oD4YwOQNhDwdf1U6xBhufCGLNs0zQbwBd4LEY/ IBWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698865005; x=1699469805; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=zXRHDnxXkEqaAnbIT/Sul4gGiiSBYwZFD1nHBP8t8J8=; b=QtErJ80M+yLwPT7xL5Bj3tmMMTbrKHXOpQ0NId8c5qKVzhfkSuHvWJOAX1Vlp2kCEz uesOswwJGi+Bipw9IOTJQZUw3d5xxrc8qRA6No9GDbPL9oZdTOyzOuhZnosOwA86/bjH upWZeSZii5b6VBwSeiyC2vWRl1UEehYNee6QjL+iSOJy3pRNFjCjqcPHDmmaB5HsW9Co ZTpAceaj4U7NVCF2LQ537ry//m3MuHuDaV4LUGYsQf14/r4e/n4A3v4ynYukw7AMNuA6 3SCpPFLnRDEiCbrIVAaG+ZltzKCqRyLcbQ6BcD5Umr7/OY+464HruY/iVF5fBKQtl/O3 D0rQ== X-Gm-Message-State: AOJu0YzR93VW1gGxEX82L9LWU2rgaxay+CZnzKj6w5m4pk9/SPjqXzQB O7y+gATa1ReERuz9s8XjcOuybrTkIcI= X-Google-Smtp-Source: AGHT+IHDg06Rf8Ie8rL5jbsJpWjO01mFL1bbuaJwaV/KfArp82A72+3Sc+xm6LAtta/lyrByuzLHUQ== X-Received: by 2002:aa7:d402:0:b0:540:fcc5:3ada with SMTP id z2-20020aa7d402000000b00540fcc53adamr14287483edq.9.1698865004722; Wed, 01 Nov 2023 11:56:44 -0700 (PDT) Original-Received: from ars3 ([2a02:8109:8ace:5100::1448]) by smtp.gmail.com with ESMTPSA id q13-20020aa7d44d000000b0053e408aec8bsm1370497edr.6.2023.11.01.11.56.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 11:56:43 -0700 (PDT) In-Reply-To: <87edh9z5d1.fsf@posteo.net> (Philip Kaludercic's message of "Wed, 01 Nov 2023 18:38:18 +0000") Received-SPF: pass client-ip=2a00:1450:4864:20::536; envelope-from=arstoffel@gmail.com; helo=mail-ed1-x536.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:312088 Archived-At: On Wed, 1 Nov 2023 at 18:38, Philip Kaludercic wrote: > Augusto Stoffel 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.