From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.devel Subject: Re: Tree-sitter maturity Date: Wed, 18 Dec 2024 17:40:39 -0800 Message-ID: References: <1ed88fca-788a-fe9f-b6c8-edb2f49751c9@mavit.org.uk> <67428b3d.c80a0220.2f3036.adbdSMTPIN_ADDED_BROKEN@mx.google.com> <86ldwdm7xg.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28785"; mail-complaints-to="usenet@ciao.gmane.io" Cc: =?utf-8?Q?Bj=C3=B6rn_Bidar?= , Peter Oliver , Stefan Kangas , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Dec 19 02:41:47 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 1tO5Xu-0007KU-CA for ged-emacs-devel@m.gmane-mx.org; Thu, 19 Dec 2024 02:41:46 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tO5X8-0005BV-09; Wed, 18 Dec 2024 20:40:58 -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 1tO5X6-0005B3-Lf for emacs-devel@gnu.org; Wed, 18 Dec 2024 20:40:56 -0500 Original-Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tO5X4-00084H-Qf; Wed, 18 Dec 2024 20:40:56 -0500 Original-Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-725abf74334so251270b3a.3; Wed, 18 Dec 2024 17:40:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734572451; x=1735177251; darn=gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=tu+Kz1y5dDoHmRVUcaIOTuJGcAb8ldRLcqkLpL54Qag=; b=OiMsf6U5WNuh5354EfTAzzPsJaK4/zbIzF0+vpzFiOxJ4jmaWjL8YtrqznXuxqBF1A zSbFL9qD5ig39sTvLHe6F0mOsum29Mj9hubz2TrdleHEItz5AK6QkZqZvbHtyLy9c11G 9qek36HMKw5TEfk4vlsYRrPeDobPEdnAMC3krWbi8HJfklKl7eHjtaUDKA5393G9tujo 3zFPTzjXCaHTF0EiVdHP5NUV02fwpbU06U6Kepr8SPtvTQHXeEsfLrKhUKa1EgXHST3M jCAO2Ot8/1+rdP1WmzXOVPja6Ly8r6RQtxqoH+WLoRcrWSb1nhazl1hQZuOMgpYvF4sI I8Yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734572451; x=1735177251; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tu+Kz1y5dDoHmRVUcaIOTuJGcAb8ldRLcqkLpL54Qag=; b=Gj9qGuZzLd2JvwGMDRN+VM9YyZPyqEEtAmz6l9EQXnZePPFqjPlPl3kFs388IxWa+E OhbteStCUXtshwcBrqvO0+zyr+JW2NSlopI7ovZBloIZFEdiffdLFhRI/yy8N9o0UqTw fqEvFd5P3tvnlNo5RX95cVmRDTd1d9CIJXvHkiaVVFxfV6e60gCxCCK+pQr8YYCIJMXB eppBItoQdjeCPuJWq0f+Jb3vvpHeZFbYSijQl4GmEQ2YCrROONxpj4xSHkOo53x3+4Mc UqtGndO9oqdImc6DKz83CdAU6NOkPIHS+DisBdu67QPTDkxr3zSaSG4zq6ZDHVlg0A/U kQwg== X-Forwarded-Encrypted: i=1; AJvYcCVNdNiInBENjNjofAHewv2RLv37eabvhNqLkjicX32qOsg4VWjmePakeGQFxI59R+VyAXwbQY22LCPkBw==@gnu.org X-Gm-Message-State: AOJu0Yyw2KsB3hIlyoeeAnBXwb0VpDJzW96E5X3E2RWrT0K07e21DfXP hzK8UyZPLGnSNRDLiunAD6pgz/t6smaROh6X3qCGIBKocPkZ/+p9wGgqFw== X-Gm-Gg: ASbGncv2I5b6EOeLv5wSPpODVJaZ+/2JpSqAwZQAyH5XsgE/JaKZrFPdRv7iD4j4U/k njtzRHMhSHgmsyXsz8XYxoFTuugfFOUeprk94pENpki4ENKrQHkb36Ck1iBwF2b7DMI5X00Rill g/8A6wW2KsxOHUbbaGorGChdjgdeG9DY72n239H7P417rNytjClIvGEJR6SqcpKQyMvleOcSSWw zgBZxy87jfCCnipBJ90EBJ5ctTO3IfOCbSVLm315RzuL3Ho6Gu3HvjMtMVLvDtJNfpvJ2TwIUhz tUmz X-Google-Smtp-Source: AGHT+IF9PulSC0f7bP1qp1Bq7ea1fhtu7reLM06FgQ1w/JHxxrwqQDR+KLk1ZiXIoevSp+mRoaHTNQ== X-Received: by 2002:a05:6a00:2313:b0:728:e906:e466 with SMTP id d2e1a72fcca58-72a8d2dc70cmr7968438b3a.21.1734572451131; Wed, 18 Dec 2024 17:40:51 -0800 (PST) Original-Received: from smtpclient.apple ([2601:646:8f81:6120:d586:f3b3:85da:8dc9]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8164d3sm131908b3a.15.2024.12.18.17.40.49 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Dec 2024 17:40:50 -0800 (PST) In-Reply-To: <86ldwdm7xg.fsf@gnu.org> X-Mailer: Apple Mail (2.3776.700.51) Received-SPF: pass client-ip=2607:f8b0:4864:20::42d; envelope-from=casouri@gmail.com; helo=mail-pf1-x42d.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:326691 Archived-At: > On Dec 18, 2024, at 5:34=E2=80=AFAM, Eli Zaretskii = wrote: >=20 >> From: Yuan Fu >> Date: Tue, 17 Dec 2024 14:11:51 -0800 >> Cc: Peter Oliver , >> Stefan Kangas , >> Emacs Devel , >> Eli Zaretskii >>=20 >>>> It=E2=80=99s 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). >>>=20 >>>=20 >>> [1] https://build.opensuse.org/package/show/editors/tree-sitter >>=20 >> 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. >>=20 >> Many major modes already adds entries to = treesit-language-source-alist, that could be a good option too. >>=20 >> 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=E2=80=99s he=E2=80=99s stance = now? >=20 > What's changed? People are starting to package tree-sitter and tree-sitter grammars. If = Emacs can be packaged with the right grammars, then tree-sitter modes = will work out-of-the-box. >=20 > 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? I=E2=80=99m talking about a softer pin. We=E2=80=99re basically = providing a =E2=80=9Cknown to work=E2=80=9D version. This way packagers = can package Emacs with a known-to-work version of grammar, so the = builtin modes work out-of-the-box. This doesn=E2=80=99t prevent people = from using a newer version and sending us a bug report, and we still try = our best to make the major modes work with the newest grammar. If the grammar doesn=E2=80=99t have an explicit version, then we can = just use a commit hash. I believe all the packaging systems support = that? Yuan