From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Tree-sitter maturity Date: Wed, 18 Dec 2024 15:34:19 +0200 Message-ID: <86ldwdm7xg.fsf@gnu.org> References: <1ed88fca-788a-fe9f-b6c8-edb2f49751c9@mavit.org.uk> <67428b3d.c80a0220.2f3036.adbdSMTPIN_ADDED_BROKEN@mx.google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1522"; mail-complaints-to="usenet@ciao.gmane.io" Cc: bjorn.bidar@thaodan.de, p.d.oliver@mavit.org.uk, stefankangas@gmail.com, emacs-devel@gnu.org To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Dec 18 14:34:40 2024 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 1tNuCG-0000Dj-FG for ged-emacs-devel@m.gmane-mx.org; Wed, 18 Dec 2024 14:34:40 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNuC2-0003Mm-N9; Wed, 18 Dec 2024 08:34:26 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tNuC0-0003La-Ek for emacs-devel@gnu.org; Wed, 18 Dec 2024 08:34:24 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tNuBz-0002w7-Hg; Wed, 18 Dec 2024 08:34:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=a9vEnngACv+WJogSzVV5AD/paVK6XAYfQeVSC6xKbPY=; b=WluU+H2Nk8/Ewfj2V3uw dK31810mWJbPc6ThbKZe8tdnBQzr2rtQnNSmOBaqqsx3ROCF2zrYwq3HqpbNMShy5s0yRKJ4wAkyE jkLYD1rfRKpXjLh9gqs26ZgWMPcjKlwTuLBiKr9RjHFA1xRlcw/VJABRO2KStbG/0DvodC7RcBaXR 0y80c/GU2YLvhkgHJgAM0XQsz71DlGb1T6o497QiPduUHMlQDzzg9uYZR2xKhlHxDcImqaOfUaL1A C3GJkMFeWQMYaHpdn4nHtGnd0RrCmJykyP8QFJGrDQe6ADcq4iGpJ3hEc4J8Fs/p2ru97jgvOfNzW ejZWSiQ+uiv6Rw==; In-Reply-To: (message from Yuan Fu on Tue, 17 Dec 2024 14:11:51 -0800) 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:326650 Archived-At: > From: Yuan Fu > Date: Tue, 17 Dec 2024 14:11:51 -0800 > Cc: Peter Oliver , > Stefan Kangas , > Emacs Devel , > Eli Zaretskii > > >> 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? What's changed? Many language grammars don't make official releases and thus don't have versions. Moreover, AFAIK there's no API to determine the version of the grammar library we load. So how can we manage such version-pinning in a way that (a) is up-to-date, and (b) doesn't preclude people from using a grammar library due to false negatives?