emacs-devel
[Top][All Lists]
Advanced

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

Re: Tree-sitter maturity


From: Yuan Fu
Subject: Re: Tree-sitter maturity
Date: Tue, 17 Dec 2024 14:11:51 -0800


> On Nov 23, 2024, at 6:10 PM, Björn Bidar <bjorn.bidar@thaodan.de> wrote:
> 
> Peter Oliver <p.d.oliver@mavit.org.uk> writes:
> 
>> On Wed, 20 Nov 2024, Stefan Kangas wrote:
>> 
>>> From my point of view, we are still in early days when it comes to the
>>> new tree-sitter modes.  For starters, we do not recommend them by
>>> default, and some language modes are also not yet ready for prime-time.
>>> I'm not even sure that a majority of distros ship the feature in a
>>> useful form yet, but I didn't really check.
>> 
>> It depends on what you mean by useful.  In Fedora, for example, Emacs is 
>> built with Tree-sitter, but each user has to (ask Emacs to) download and 
>> compile each parser as they go along.
>> 
>> If any Fedora packagers read this and would like to help with
>> packaging the parsers used by Emacs, that would be welcome.  The
>> tracking bug is https://bugzilla.redhat.com/show_bug.cgi?id=2258924
> 
> Feel free to take a look into the RPM packaging I created for SUSE.
> There should be a way to collaborate on that if anyone is interested. [1]
> 
> Using that packaging all the user has to do is to install the required
> grammar they want.
> 
>> It’s also worth noting that Tree-sitter itself is somewhat immature; the 
>> developers say that until it reaches version 1.0, we should be wary of 
>> potentially unannounced incompatible changes (although they are trying 
>> harder to avoid this, over time).
> 
> 
> [1] https://build.opensuse.org/package/show/editors/tree-sitter

I wonder if we can formalize a way for tree-sitter major modes to state the 
compatible version of language grammar it uses. Maybe a package.el cookies, or 
a variable that set, or even just comments in the beginning of the file.

Many major modes already adds entries to treesit-language-source-alist, that 
could be a good option too.

I especially want built-in major modes to give a version, so that packagers can 
package Emacs with the right version of tree-sitter grammar. I know Eli has 
problems with pinning a grammar version for builtin modes before, but I wonder 
what’s he’s stance now?

Yuan


reply via email to

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