emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why tree-sitter instead of Semantic? (was Re: CC Mode with font-lock


From: Lynn Winebarger
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

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 <eliz@gnu.org> wrote:
> From: Po Lu <luangruo@yahoo.com>
> Cc: Eli Zaretskii <eliz@gnu.org>,  Alan Mackenzie <acm@muc.de>,  emacs-devel
>  <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 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]