From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: chad Newsgroups: gmane.emacs.devel Subject: Re: Renaming eglot -- or at least add an alias? Date: Sat, 8 Oct 2022 14:18:10 -0400 Message-ID: References: <83pmfdduix.fsf@gnu.org> <86wn9ji3ma.fsf@gmail.com> <86tu4lsnqk.fsf@gmail.com> <83ill0vzit.fsf@gnu.org> <835ygzv4p3.fsf@gnu.org> <861qrlztre.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000a3dc8a05ea89f350" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33547"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Tim Cross , eliz@gnu.org, emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Oct 08 20:19:31 2022 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 1ohEQ7-0008Yc-EP for ged-emacs-devel@m.gmane-mx.org; Sat, 08 Oct 2022 20:19:31 +0200 Original-Received: from localhost ([::1]:54754 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ohEQ6-0000eC-1j for ged-emacs-devel@m.gmane-mx.org; Sat, 08 Oct 2022 14:19:30 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33160) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohEP9-0008PG-Ff for emacs-devel@gnu.org; Sat, 08 Oct 2022 14:18:31 -0400 Original-Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]:33635) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ohEP3-0006Z6-VZ; Sat, 08 Oct 2022 14:18:31 -0400 Original-Received: by mail-ej1-x635.google.com with SMTP id q9so12899482ejd.0; Sat, 08 Oct 2022 11:18:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=2BuWs5eJnYenPTVZb9z8Xm8Sik3wtEXUpBcZO4oMeQ4=; b=LMPNW7aZjhSnxkFp32kf9i4hkNAgrEI0SMtoQik6svRrvLtpWQL2f02PRirw6bmOd/ hq7EnRjb1bX6TUOVAfWrioJUADnrIOd8pTjYCyRFzY0P+6TyWTqigHx0G6mTQJfzyPGp oUhBVBKds/GJF++9B8NDnuBLovmf1XizwbgGVdcuXF8Smy7zMWtXZMOPFX5L6rowT8G7 VAhxSaSx3Jsr1hCEVrjFA0IVTcct48giDZj0JkYdSISRDP+9aI/OJy2thVQbIPw5nFRZ au/eYA8pGLBn9B6RsbQt81stiJF84jvJsRbYRdTMP1Kk5MDFQGX5TwFFvVTQr92DRtwO x6zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=2BuWs5eJnYenPTVZb9z8Xm8Sik3wtEXUpBcZO4oMeQ4=; b=FJwYIQOzC1FblaTY93UCmphDJZa7Q/MGUK52bYJ9ZGYKkqE64dPq/lkrtN7gF2ZuVc 5nCKzkcfNzC0jutCDQf1foSRQsqIid/p4Fv0dAXk6TXuAPupdYMNeMxlzAsNw7fXuxOo 7BRuJLlIWvrKgl5SFXh2qXeC+5M6NLel+brfccmXJKIOKFE0A9/MTwMuM2Vv+ez5HGUV f4GyYlriWbv51S/wxQRVRwzNDxy8sGki/7ujllmzooxSZqND78hVrI3jrjyTHT3RdM69 UaCR31iPfR9Ixfp5i2ziZAo7h1my0rbJJ2VTf4/gLMIuYfUXJPvMyXKN7GX2Ecu5KieS Ro4A== X-Gm-Message-State: ACrzQf14FcMvpgEY2+DHhXGG3WRfgOye5MaCr3OslBVhcqQr5c6+iVww kx+5GPiKRrWbgqYkXWGkxNyGiUrhxFT5Cgnv3jQe1IGv X-Google-Smtp-Source: AMsMyM49zql2vzMRaexVf1Py0ZcKBX+hmLwd959E7XbA1pi/1qKdt+v2a2ofycf6zYdLBD1fGnjjbhezPVjGVdDrTUo= X-Received: by 2002:a17:906:7007:b0:6ff:8028:42e with SMTP id n7-20020a170906700700b006ff8028042emr8544026ejj.278.1665253102573; Sat, 08 Oct 2022 11:18:22 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::635; envelope-from=yandros@gmail.com; helo=mail-ej1-x635.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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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" Xref: news.gmane.io gmane.emacs.devel:297218 Archived-At: --000000000000a3dc8a05ea89f350 Content-Type: text/plain; charset="UTF-8" On Fri, Oct 7, 2022 at 6:56 PM Richard Stallman wrote: > It sounds like the commands for using Semantic on a file may be very > different from the commands for using Eglot on that same file. > Is that right? > "Commands" is probably the wrong way to think about both Semantic/EDE and eglot (and lsp-mode, etc). The high-level idea in both cases is to enhance existing emacs facilities (including those that are enabled by default, those that are shipped with emacs but must be enabled by the user, and those that are packaged separately from the emacs core) by adding a more in-depth comprehension of the code the user is examining, modifying, writing, etc. Many of these facilities (absent something like Semantic/EDE/eglot/lsp/etc) using heuristics, conventions, and regexp-based functionality to try to "understand" the code, and then use that understanding to help the programmer, for examples, with fontification, completion, pop-up documentation, additional navigation, and the like. I believe that a big part of the difficulty of putting a concrete handle on "what does eglot (or semantic) do?" comes in here: many of the things that are enabled/enhanced are already present in emacs. For example, M-. runs xref-find-definitions to find the definition of the thing at point. Emacs has had this functionality for a long time, and there are several optional packages that enhance it, using TAGS, rtags, ag, or gnu global to *find* the reference, or using helm or ivy to access the references. Semantic and eglot (among others) add functionality that attempts to understand the code using the same mechanism that, for example, compilers use. (In Semantic's case, it implements compiler-like tokenizer/lexer/parser functionality in elisp; the Language Server Protocol (LSP) approach is instead to use an external tool, often built from the same parts as the compiler/interpreter, and communicate the "relevant information" over a channel to an editor). In this sense, the "eglot commands" are just the ancillary machinery to make the enhancements happen "in the background" -- telling emacs to start using the facility, managing the connection and the external process, and, importantly, configuring that external machinery. That last is important because there is no "one true LSP server", even for a given language, so configuration is required. We can hope that this will settle out over time, but LSP (the protocol that the external tools use to provide editor-agnostic* information) is still developing, and people are discovering new ways to integrate a deeper understanding of code into editing (and reviewing, debugging, etc.) environments. About Semantic: as has probably become clear by the time you read this, one of the particular issues of this precise moment in the conversation is that Semantic *does* parse the code in question, whereas eglot instead serves as a bridge between the external tools that parse (and more) the code and emacs' existing (and upcoming) features for editing (reviewing, etc.) code. In a rough analogy, Semantic can be thought of as "let's replace rcs.el with something like CVS implemented mostly in elisp", while eglot (and its cousin lsp-mode) are much more like VC -- the glue between emacs and a variety of external tools for grokking C, JavaScript, Python, etc. VC abstracts over "version control". Gnus abstracts over "message systems". Eglot attempts to abstract over "understanding (computer) languages". Hope that helps, ~Chad --000000000000a3dc8a05ea89f350 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Fri, Oct 7, 2022 at 6:56 PM Richar= d Stallman <rms@gnu.org> wrote:
It sounds like the commands for using Semantic on a file may be very
different from the commands for using Eglot on that same file.
Is that right?

"Commands" is = probably the wrong way to think about both Semantic/EDE and eglot (and lsp-= mode, etc). The high-level idea in both cases is to enhance existing emacs = facilities (including those that are enabled by default, those that are shi= pped with emacs but must be enabled by the user, and those that are package= d separately from the emacs core) by adding a more in-depth comprehension o= f the code the user is examining, modifying, writing, etc.

Many of these facilities (absent something like Semantic/EDE/eglot= /lsp/etc) using heuristics, conventions, and regexp-based=C2=A0functionalit= y=C2=A0to try to "understand" the code, and then use that underst= anding to help the programmer, for examples, with fontification, completion= , pop-up documentation, additional navigation, and the like.

=
I believe=C2=A0that a big part of the difficulty of putting a co= ncrete handle on "what does eglot (or semantic) do?" comes in her= e: many of the things that are enabled/enhanced are already present in emac= s. For example, M-. runs xref-find-definitions to find the definition of th= e thing at point. Emacs has had this functionality for a long time, and the= re are several optional packages that enhance it, using TAGS, rtags, ag, or= gnu global to *find* the reference, or using helm or ivy to access the ref= erences. Semantic and eglot (among others) add functionality that attempts = to understand the code using the same mechanism that, for example, compiler= s use. (In Semantic's=C2=A0case, it implements compiler-like tokenizer/= lexer/parser functionality in elisp; the Language Server Protocol (LSP) app= roach is instead to use an external tool, often built from the same parts a= s the compiler/interpreter, and communicate the "relevant information&= quot; over a channel to an editor).

In this sense,= the "eglot commands" are just the ancillary machinery to make th= e enhancements happen "in the background" -- telling emacs to sta= rt using the facility, managing the connection and the external process, an= d, importantly, configuring that external machinery. That last is important= because there is no "one true LSP server", even for a given lang= uage, so configuration is required. We can hope that this will settle out o= ver time, but LSP (the protocol that the external tools use to provide edit= or-agnostic* information) is still developing, and people are discovering n= ew ways to integrate a deeper understanding of code into editing (and revie= wing, debugging, etc.) environments.

About Semanti= c: as has probably become clear by the time you read this, one of the parti= cular issues of this precise moment in the conversation is that Semantic *d= oes* parse the code in question, whereas eglot instead serves as a bridge b= etween the external tools that parse (and more) the code and emacs' exi= sting (and upcoming) features for editing (reviewing, etc.) code.=C2=A0

In a rough analogy, Semantic can be thought of as &qu= ot;let's replace rcs.el with something like CVS implemented mostly in e= lisp", while eglot (and its cousin lsp-mode) are much more like VC -- = the glue between emacs and a variety of external tools for grokking C, Java= Script, Python, etc.=C2=A0 VC abstracts over "version control". G= nus abstracts over "message systems". Eglot attempts to abstract = over "understanding (computer) languages".=C2=A0

Hope that helps,
~Chad
--000000000000a3dc8a05ea89f350--