From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lynn Winebarger Newsgroups: gmane.emacs.devel Subject: Re: Why tree-sitter instead of Semantic? (was Re: CC Mode with font-lock-maximum-decoration 2) Date: Tue, 16 Aug 2022 06:42:23 -0400 Message-ID: References: <83o7wuva9o.fsf@gnu.org> <83mtceupbx.fsf@gnu.org> <83lerxvfnu.fsf@gnu.org> <838rnxvdcq.fsf@gnu.org> <83r11ptksn.fsf@gnu.org> <83a68dti6w.fsf@gnu.org> <874jykzvx9.fsf@yahoo.com> <017dcda1-cbff-8afa-0c70-a32224c89b8c@siege-engine.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000000a81905e659681b" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7798"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Po Lu , Eli Zaretskii , Alan Mackenzie , emacs-devel To: Eric Ludlam Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Aug 16 12:43:16 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 1oNu2W-0001pE-G3 for ged-emacs-devel@m.gmane-mx.org; Tue, 16 Aug 2022 12:43:16 +0200 Original-Received: from localhost ([::1]:40872 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oNu2V-0005jF-1C for ged-emacs-devel@m.gmane-mx.org; Tue, 16 Aug 2022 06:43:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:32834) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oNu1u-00051q-FQ for emacs-devel@gnu.org; Tue, 16 Aug 2022 06:42:38 -0400 Original-Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]:52874) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oNu1s-0001vw-Kf; Tue, 16 Aug 2022 06:42:38 -0400 Original-Received: by mail-pj1-x102f.google.com with SMTP id ha11so9398117pjb.2; Tue, 16 Aug 2022 03:42:35 -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; bh=Esm0jBG0WQCPhUkMEmhmtfccAI7mv/dmK8hFQHvqF3s=; b=iTqi8do8xE816+k7I9CyMKXyK0Rr75ZWTjaUty3kQ4Gbjxa0bCPigS9E0+lA7qOSZ9 4HCrzPW7KJ+/r82vVWDSSRNrUiqaeTvLbXb3QA3f0ZIQUXtSIpBjsi3uaEXF6oR7ghmV ApCLkxohoZADTkgBcyOABAEWMUZYgnokSMjMulAGVvSCwcZjHJ65nUtpC8nlMk8PulN4 YgqCG85z0lFIzfjKHg40cPOnd7VgLALwpJZibhkY6PqKZpEg9PO8XnEdAtzEpjLmo7bw 96DR86uXCQvuaX2KHlIGuKG1JrXRN8jUeXUrL/MnwN2sox+lGPDoGwCep7ENX9orMpJ5 cjVQ== 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; bh=Esm0jBG0WQCPhUkMEmhmtfccAI7mv/dmK8hFQHvqF3s=; b=A88WH2XoMj8k8rG/eNce4uRfqubWrGYHPr8Ff3mYasY5NF9oxc4BWCYuyT1IKnZ7cg I3DcmtsUL5ic/CVsV0gK2NZk6yGJeCscYXz8Sdtopp1Toha5iu9f/hWVf1Y12NkSSSTv xqa9GRElyDinTMs/stL5AMppMviRKv55T66lHKJcuUXZ26azuF5zKPM26QQvYtRD0V6M znX8znJjOoa5v2M1tiuId3VjJaZ4yeiGpR1fdg/EdvBcOiS8V0tDiG1a+BzMFpjsH3jP ylSIV8N0oW2mshsi3aEfWlj4OJl+meeMABJtPRAiOJ0xA1mwhfMp/FnrTeFQ054uNDAo BpuQ== X-Gm-Message-State: ACgBeo3e5Fy9+aQSZYlyqUjuBKKhIJAzqPB9ZvUeLOst3o9tBlsdpDlg eGllXDoapcqPfruqhrRPbE6nsu8XUiZ0NxtTY6A= X-Google-Smtp-Source: AA6agR6rvHjY2/E3pcIdUT1qaTs7nBS0ZPSOW1sQTMy10Y738pJdbiBST2QAa8NkO0sWkuUdv3T2sw/0A4uiHxHMMxs= X-Received: by 2002:a17:902:e30c:b0:171:2036:532c with SMTP id q12-20020a170902e30c00b001712036532cmr21769658plc.121.1660646554903; Tue, 16 Aug 2022 03:42:34 -0700 (PDT) In-Reply-To: <017dcda1-cbff-8afa-0c70-a32224c89b8c@siege-engine.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::102f; envelope-from=owinebar@gmail.com; helo=mail-pj1-x102f.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, 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" Xref: news.gmane.io gmane.emacs.devel:293497 Archived-At: --00000000000000a81905e659681b Content-Type: text/plain; charset="UTF-8" On Sun, Aug 14, 2022 at 3:24 PM Eric Ludlam wrote: > > On 8/9/22 10:14 PM, Po Lu wrote: > > Lynn Winebarger writes: > > > >> I'm curious, though, as to why Semantic/CEDET seems to have been > >> superceded by external solutions like tree-sitter or LSP-based > >> (non-emacs) servers. One of the draws of Emacs for me is the > >> "batteries included" nature of it having Emacs Lisp built in. Is > >> there a downside to using Semantic as the basis for improving my > >> derived mode that's non-obvious? > > > > I think Semantic lost intertia after the original author lost interest > > in it (or left for unrelated reasons, I don't remember which.) > > I eventually stopped pushing on CEDET for a few reasons - but a big one > was that I don't code professionally anymore, and trying to wrestle the > legal paperwork from my company and merges between repositories > necessitated by those restrictions was just too troublesome. Unfortunately, I feel your pain. > I was also frequently surprised by how hard it was to get CEDET to 'just > work' well enough for everyone to use it as intended, and how often > people just jumped over to simpler one-off external tools because the > full suite way CEDET works was too heavy a lift. That in turn resulted > in not a lot of contributors to help support/improve those workflows. > Tools like LSP also became good enough where there was no way I could > keep up. I had hoped to pull data from external tools like lsp into the > framework CEDET used, but again the simpler one-off tools were too > appealing to that audience. > > Overall, I think that is fine though - having many projects > experimenting with different techniques, and having the best solution > win is the benefit of free software. Developing CEDET back when it was > the only game it town was a good time with many good people helping, and > I am glad to have been a part of that, and I'm glad CEDET is still > useful in many cases. I think there should be a substantive place for such a framework in Emacs, regardless of external tools that can be used to provide some of the analysis. Even if a mode doesn't use the parser generated by a grammar, the grammar can also provide a description of the syntactic structure that can be used in separating fontification from syntactic analysis. If I understand it correctly, Semantic provides support for that generic approach and tying the classification to the text through overlays It should be straightforward for a major mode to create a set of faces that can be applied generically by font-lock based on those overlays instead of via regular expressions on the underlying text. I've skimmed lsp-mode, but I can't tell how it attaches the analysis from the server to the text. Just looking at tsc-core's GitHub page, I don't see a similar generic approach being provided. I get the impression there is a lot of dependence on the individual language/mode as to how the information gets incorporated in the fontification. Lynn --00000000000000a81905e659681b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Sun, Aug 14, 2022 at 3:24 PM Eric Ludlam <ericl= udlam@gmail.com> wrote:
>
> On 8/9/22 10:14 PM, Po Lu wrote:
> > Lynn Winebarger <owinebar@gmail.com> writes:
> >
> >> I'm curious, though, as to why Semantic/CEDET seems to ha= ve been
> >> superceded by external solutions like tree-sitter or LSP-base= d
> >> (non-emacs) servers.=C2=A0 One of the draws of Emacs for me i= s the
> >> "batteries included" nature of it having Emacs Lisp= built in.=C2=A0 Is
> >> there a downside to using Semantic as the basis for improving= my
> >> derived mode that's non-obvious?
> >
> > I think Semantic lost intertia after the original author lost int= erest
> > in it (or left for unrelated reasons, I don't remember which.= )
>
> I eventually stopped pushing on CEDET for a few reasons - but a big on= e
> was that I don't code professionally anymore, and trying to wrestl= e the
> legal paperwork from my company and merges between repositories
> necessitated by those restrictions was just too troublesome.

Unfortunately, I feel your pain.

> I was also frequently surprised by how hard it was to get CEDET to = 9;just
> work' well enough for everyone to use it as intended, and how ofte= n
> people just jumped over to simpler one-off external tools because the<= br> > full suite way CEDET works was too heavy a lift.=C2=A0 That in turn re= sulted
> in not a lot of contributors to help support/improve those workflows.<= br> > Tools like LSP also became good enough where there was no way I could<= br> > keep up.=C2=A0 I had hoped to pull data from external tools like lsp i= nto the
> framework CEDET used, but again the simpler one-off tools were too
> appealing to that audience.
>
> Overall, I think that is fine though - having many projects
> experimenting with different techniques, and having the best solution<= br> > win is the benefit of free software.=C2=A0 Developing CEDET back when = it was
> the only game it town was a good time with many good people helping, a= nd
> I am glad to have been a part of that, and I'm glad CEDET is still=
> useful in many cases.

I think there should be a substantive place for such a framework in Emacs, = regardless of external tools that can be used to provide some of the analys= is.=C2=A0 Even if a mode doesn't use the parser generated by a grammar,= the grammar can also provide a description of the syntactic structure that= can be used in separating fontification from syntactic analysis.=C2=A0 If = I understand it correctly, Semantic provides support for that generic appro= ach and tying the classification to the text through overlays=C2=A0 It shou= ld be straightforward for a major mode to create a set of faces that can be= applied generically by font-lock based on those overlays instead of via re= gular expressions on the underlying text.
I've skimmed lsp-mode, but I can't tell how it attaches the analysi= s from the server to the text.
Just looking at tsc-core's GitHub pag= e, I don't see a similar generic approach being provided.=C2=A0 I get t= he impression there is a lot of dependence on the individual language/mode = as to how the information gets incorporated in the fontification.

Lynn

--00000000000000a81905e659681b--