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: Sun, 29 Dec 2024 10:41:48 +0200 Message-ID: <86bjwuricz.fsf@gnu.org> References: <1ed88fca-788a-fe9f-b6c8-edb2f49751c9@mavit.org.uk> <67428b3d.c80a0220.2f3036.adbdSMTPIN_ADDED_BROKEN@mx.google.com> <86ldwdm7xg.fsf@gnu.org> <6765355b.c80a0220.1a6b24.3117SMTPIN_ADDED_BROKEN@mx.google.com> <00554790-CACA-4233-8846-9E091CF1F7AA@gmail.com> <86msgl2red.fsf@gnu.org> <87o710sr7y.fsf@debian-hx90.lan> <8734i9tmze.fsf@posteo.net> <86plldwb7w.fsf@gnu.org> <87ttapryxr.fsf@posteo.net> <0883EB00-3BB2-4BC8-95D1-45F4497C0526@dancol.org> <87plldrx6a.fsf@posteo.net> <87ikr5rwx0.fsf@posteo.net> <86ed1rq6gc.fsf@gnu.org> <73737665-984E-4C97-9183-7805C1BCB550@dancol.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25092"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Daniel Colascione Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Dec 29 09:42:26 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 1tRosT-0006PC-Jn for ged-emacs-devel@m.gmane-mx.org; Sun, 29 Dec 2024 09:42:25 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRos0-0004ie-8B; Sun, 29 Dec 2024 03:41:56 -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 1tRorx-0004fw-4M for emacs-devel@gnu.org; Sun, 29 Dec 2024 03:41:54 -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 1tRorw-0008Tk-Fa; Sun, 29 Dec 2024 03:41:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=UgxpRKCgUtv6Rv37R1HrD2JO+aeJ0hFKwnyZPboeBts=; b=rxv/M2KyPNyQ Jlr2hKnKMSGaQr6786zLnG6Bij+lqQFnCSPsURvpeVPxdpJx48MbgCJOaK1St8/YsQX+Ihm4B6B3H zN2hSG7BNgw1xzXSwZCdVp/jIaFuqfNi+zpcKYEYQduHD/fAnn8eVtCsIQ13j3ztaGJTjxfv8ntvo Gg/lNBQaCz6xohzuX1B77loBSb7bIT19NijdE/3ofmlRbFr2sTmHT0Xxbg0w0qtO18/vjIMzAH6om yTlBfbVitLdF9YoaDSIn/kYz0LJU0XHiMgee2Ep27EMxc4V3Pj01HpZrUJvvmCaQJHrqljFwOCnFN SHX3dQWLyVPcQBz/H7axSg==; In-Reply-To: <73737665-984E-4C97-9183-7805C1BCB550@dancol.org> (message from Daniel Colascione on Sun, 29 Dec 2024 03:01:44 -0500) 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:327322 Archived-At: > Date: Sun, 29 Dec 2024 03:01:44 -0500 > From: Daniel Colascione > > >> Enforcing this policy will just mean that Emacs doesn't support *at all* some languages out of the box and will put even more wind in the sails of soft forks like Doom. Tree sitter language descriptions are free software. There's no reason not to rely on them. > > > >We started with this concept of adding tree-sitter based modes to > >auto-mode-alist by default, but found that people who don't have the > >grammar installed didn't appreciate seeing the warnings about the > >missing grammars. So Emacs 29 made these modes optional, activated > >only by an explicit user action. Emacs 30 still does that. > > > >We are currently discussing how to improve this (see the thread Re: > >Turning on/off tree-sitter modes, which seems to have stalled lately). > >But until the grammar libraries are ubiquitous, and we can rely on > >them being present on most systems, I think we will still need some > >user say-so before enabling tree-sitter based modes. > > Wouldn't vendoring the grammars, and maybe even tree sitter itself, silence the complaints about the warnings? Tree sitter is pure algorithmic code. It doesn't have any particular platform dependencies. Why not simplify the whole system and make it a mandatory (and optionally bundled) dependency so that the show cognitive load of having to consider non-TS environments is just deleted? First, the tree-sitter library itself is optional, so Emacs could be built without it. Or are you suggesting to import the library as well into Emacs? If we don't import the library, making it a mandatory dependency is not TRT, IMO, because some users don't need the modes supported by tree-sitter, so forcing them to install the library that is not really useful to them is not right. We never do anything like that with any other external libraries. GMP is special, but even for it we added our own "mini-gmp". Next, importing the grammar libraries into Emacs is not a simple matter, either. Their sources are in JavaScript, so if we want to let users produce modified grammars (as we do with everything we have in the release tarballs), they will need to have Node.js etc. installed, which will become a prerequisite. And there are other complications, like the need to sync regularly with their upstream repositories. Moreover, there's no precedent for doing this, if you exclude lwlib and oldXMenu (which are different, since they are not developed outside Emacs). So I, for one, am not very happy to add this to our maintenance burden. It might make things easier for some (but see below), but it doesn't come for free. I also don't understand the fuss, really. Compiling a grammar library after cloning the repository takes seconds, so why do we have to do all this on behalf of the users if the users can do it so easily, even if distros don't? E.g., I have on my system almost 70 grammar libraries, which I regularly update and build with a small number of simple Makefiles -- how hard can that be for anyone who is interested in these modes? Why does it have to be _our_ responsibility, any more than, say, Grep or Findutils -- which are also heavily used by Emacs? Or even the image libraries? Why shouldn't this be the job of the distros? The upstream project doesn't have to think about packaging, it's the job of the distros. Can you describe why the current situation means "cognitive load" on you personally? Because I don't think I see the problem, honestly.