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 introduction documentation Date: Tue, 27 Dec 2022 14:11:29 +0200 Message-ID: <83y1qt11xq.fsf@gnu.org> References: <83edszjslp.fsf@gnu.org> <87tu1vxs3a.fsf@ledu-giraud.fr> <831qozjob7.fsf@gnu.org> <87cz8jxoat.fsf@ledu-giraud.fr> <83wn6ri7pn.fsf@gnu.org> <5e0a3185-de82-b339-0fa2-956779e63d6f@cornell.edu> <868rj6vfep.fsf@gmail.com> <4895891b-e5ea-9c37-f51b-df2e479ee758@yandex.ru> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10244"; mail-complaints-to="usenet@ciao.gmane.io" Cc: monnier@iro.umontreal.ca, theophilusx@gmail.com, emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Dec 27 13:12:08 2022 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 1pA8oR-0002W5-TV for ged-emacs-devel@m.gmane-mx.org; Tue, 27 Dec 2022 13:12:07 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pA8nn-0003el-C4; Tue, 27 Dec 2022 07:11:27 -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 1pA8nl-0003eH-NO for emacs-devel@gnu.org; Tue, 27 Dec 2022 07:11:25 -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 1pA8nl-0002g1-2z; Tue, 27 Dec 2022 07:11:25 -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=udjBKJlr97hO9QaKuYyd64DVxKXG2Pxa/WJNyvYVWzY=; b=hPcphCk9qhga sS67b0oLUN6bbva+XY7+a3eLxTHgMvfZ9wIoxIJyUvRrvsUAO0xQfDb+MvvyOStd3SGPIAMqadgKn At1X3HQRtDg1ijoF/bf5STNYnHxy5oD3Pey/qbOve4TtnwI/03q3d2x5G6/RD6tYTto4kgFinNiRe wzPK298em6P9Pg76+7tecrztlhj+dRgeFbh6nFnT3dg8nxYwStUEId7X0u5SRcDGPekj8juwW1pVv c28mXdRKO8F6WUl3E3Tp7MX6liHbkA3hLYl76AnBMPSCf4Wk+2XL1EtgL/pzs9+D/hAUrXIR3VRf7 jLK/4FTdMCjE/YZ9IN4g5A==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pA8nk-0003l0-B1; Tue, 27 Dec 2022 07:11:24 -0500 In-Reply-To: <4895891b-e5ea-9c37-f51b-df2e479ee758@yandex.ru> (message from Dmitry Gutov on Tue, 27 Dec 2022 00:42:55 +0200) 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:301955 Archived-At: > Date: Tue, 27 Dec 2022 00:42:55 +0200 > Cc: emacs-devel@gnu.org > From: Dmitry Gutov > > On 17/12/2022 17:42, Stefan Monnier wrote: > > Those grammars have been in use for a while now > > (by other editors), AFAIK, so why would the situation change just because > > Emacs starts to use them as well? > > I guess "other editors" that use tree-sitter do bundle the grammars? > > Or include them in the optional language packages. Or provide built-in > recipes to install them. WDYT about what we have in NEWS about this? > E.g. nvim-treesitter seems to be doing the latter: > https://github.com/nvim-treesitter/nvim-treesitter#language-parsers > > The corresponding recipes look like: > > list.ruby = { > install_info = { > url = "https://github.com/tree-sitter/tree-sitter-ruby", > files = { "src/parser.c", "src/scanner.cc" }, > }, > maintainers = { "@TravonteD" }, > } It sounds like a non-trivial maintenance burden to keep this kind of DB up-to-date. So I'm not sure we should do this in the upstream project. But if Someone(TM) wants to provide Emacs commands to download, compile, and install a grammar library, I see no reason not to add that to Emacs. This could be part of treesit.el, for example. One condition, though: please implement the commands in Emacs Lisp, without invoking any shell scripting features (which shouldn't be needed to begin with), just by using compiler, Emacs commands and functions that deal with files, and (possibly) Git. Also, if we provide some list of grammar libraries we support officially and their respective sites, that list should include only libraries with a Free license.