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: Wed, 10 Aug 2022 06:05:56 -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> <83fsi4sttn.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000ab81e605e5e032fa" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36471"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Po Lu , Alan Mackenzie , emacs-devel , Stefan Monnier To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Aug 10 12:29:49 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 1oLiyB-0009JB-Dx for ged-emacs-devel@m.gmane-mx.org; Wed, 10 Aug 2022 12:29:47 +0200 Original-Received: from localhost ([::1]:32772 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oLiyA-0002N7-5W for ged-emacs-devel@m.gmane-mx.org; Wed, 10 Aug 2022 06:29:46 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34328) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oLibN-0006tt-M3 for emacs-devel@gnu.org; Wed, 10 Aug 2022 06:06:13 -0400 Original-Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]:51930) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oLibL-0000xB-M4; Wed, 10 Aug 2022 06:06:13 -0400 Original-Received: by mail-pj1-x102e.google.com with SMTP id t22so14284305pjy.1; Wed, 10 Aug 2022 03:06:10 -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=DRHvpFBpZGSfclEDjXGgRr2bm7eg8LiyJ9fBUv2C+cY=; b=jY/VlYvja9clMhKEkix6os6egWym3Q79mqxslaVOdPcs78Jem+jxgpCaRdWyrtMICR E7jsP1Bm32IZUdX/4twfBFCME1s1WrRIMPJwdhYERvuaejoAijfEQElwd6eBcvias3+n 0kDwraP4F9Mjy4xRbmI4Oq/L1g1ujhxxTFsJP3hi6S0D2sDOBE3dh0S+qVN8VKVrYU7q BD03CQLb3R/j7TAs57x4B6JiO54EKkOSrX18gbgYLPOgJ8S0cLRoetj/qx3m7hcZYsVG /m4oSAAiFGJygIT+9+Drk1PzmQr3vfhUnbj5rCtDxZBr74e+nTF2Qk8MUkLoLPTxVx5e PQiA== 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=DRHvpFBpZGSfclEDjXGgRr2bm7eg8LiyJ9fBUv2C+cY=; b=s0MbOOKvdI9BUzRfMImR/M9FHT2Or+Gd8qYUDqWl9hJ1hvYwhWIhZJO0+/BagvDljQ F2NOFA9BANjJMfSJCakU7sgogX8psL1EJQeat5yOYVn/r7ASDkpfvIdtjOxy0ZR8qyEy 6CD10XmxEvOyDIsAnsmkeD+J/PUTfnqnCnGM4DZeRrZ6X11YUbBIVVPo+R4tc09p8H8+ X7nqwtuYdafSZ9Q2w/JfSpXo0LL7Rc+RMxk6MMPDjm4XtDhYFP6Rrr9tteMSPw6sj/Xg SHtA/tHpDiuOrKg45UN0rGoxHqwdYjJX6brOu60tiTHnothNhXEXOfaeVcBvdMFTMuPo SBHA== X-Gm-Message-State: ACgBeo1BVTOGpH5UJIRNrNbZ2TBRV1HtwaRQRdGfhStzgeL3sTf76PpS +lo0DwEOMXEei40yxXRyYaSDRmgMOUWbvtbuitXoAnBI X-Google-Smtp-Source: AA6agR6WoHipGxBoc5QGBEvNfJjJLTCzMg+fZ3Sp9RNWEzmtk8kMFVHJrmBFDP18AAAfXzMjb92+iSwnsv3U9oyp6fI= X-Received: by 2002:a17:902:e30c:b0:171:2036:532c with SMTP id q12-20020a170902e30c00b001712036532cmr7214554plc.121.1660125969087; Wed, 10 Aug 2022 03:06:09 -0700 (PDT) In-Reply-To: <83fsi4sttn.fsf@gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::102e; envelope-from=owinebar@gmail.com; helo=mail-pj1-x102e.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:293345 Archived-At: --000000000000ab81e605e5e032fa Content-Type: text/plain; charset="UTF-8" Explicitly adding Stefan M on the CC: list since, as I understand it, he is a primary driver of tree-sitter integration, as well as having been involved in bringing Semantic/CEDET into the core (if I'm not misremembering the acknowledgements in the source code and/or doc files). On Tue, Aug 9, 2022, 10:42 PM Eli Zaretskii wrote: > > From: Po Lu > > Cc: Eli Zaretskii , Alan Mackenzie , > emacs-devel > > > > Date: Wed, 10 Aug 2022 10:14:58 +0800 > > > > 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.) > > It is simply too slow to be a modern solution for these features. > Can you (or anyone on the list) provide a more detailed analysis? Is the slowness inherent in the algorithm design, the implementation method (eg table driven parsing designed before the availability of the native compiler), the basic synchronous nature of ELisp, the impact on garbage collection, etc? If the analyzer were run in a second emacs process using mmaped files to share buffers being analyzed, then communicating the results either via LSP or some other channel, would that make it usable? There are dangling references in the semantic/wisent manual to docs that are in the last sourceforge repo around the time of the migration into core emacs, but never made it in. The grammar framework doc in particular is needed to make sense of the existing grammars. I've definitely noticed more pausing with Semantic turned on, but it's not unusable so far (but I'm also not looking at any C++ source, just ELisp and C, maybe some shell scripts, info files and Markdown). Lynn --000000000000ab81e605e5e032fa Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Explicitly adding Stefan M on the CC: list since, as I underst= and it, he is a primary driver of tree-sitter integration, as well as havin= g been involved in bringing Semantic/CEDET into the core (if I'm not mi= sremembering the acknowledgements in the source code and/or doc files).

On Tue, Aug 9, 2022, 10:42 PM Eli Zaretskii <eliz@gnu.org> wrote:
> From: Po Lu <luangruo@yahoo.com>
> Cc: Eli Zaretskii <eliz@gnu.org>,=C2=A0 Alan Mackenzie <acm@muc.de&= gt;,=C2=A0 emacs-devel
>=C2=A0 <emacs-devel@gnu.org>
> Date: Wed, 10 Aug 2022 10:14:58 +0800
>
> Lynn Winebarger <owinebar@gmail.com> writes:
>
> > I'm curious, though, as to why Semantic/CEDET seems to have b= een
> > superceded by external solutions like tree-sitter or LSP-based > > (non-emacs) servers.=C2=A0 One of the draws of Emacs for me is th= e
> > "batteries included" nature of it having Emacs Lisp bui= lt in.=C2=A0 Is
> > there a downside to using Semantic as the basis for improving my<= br> > > 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.)

It is simply too slow to be a modern solution for these features.

Can you (o= r anyone on the list) provide a more detailed analysis?=C2=A0 Is the slowne= ss inherent in the algorithm design, the implementation method (eg table dr= iven parsing designed before the availability of the native compiler), the = basic synchronous nature of ELisp, the impact on garbage collection, etc?
If the analyzer were run in a second emacs process us= ing mmaped files to share buffers being analyzed, then communicating the re= sults either via LSP or some other channel, would that make it usable?

There are dangling reference= s in the semantic/wisent manual to docs that are in the last sourceforge re= po around the time of the migration into core emacs, but never made it in.= =C2=A0 The grammar framework doc in particular is needed to make sense of t= he existing grammars.=C2=A0

I've definitely noticed more pausing with Semantic turned on, but i= t's not unusable so far (but I'm also not looking at any C++ source= , just ELisp and C, maybe some shell scripts, info files and Markdown).

Lynn



--000000000000ab81e605e5e032fa--