From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.devel Subject: Re: Is it better to add treesitter modes to core? Date: Mon, 08 Jan 2024 06:15:07 +0000 Message-ID: <871qas8i6s.fsf@posteo.net> References: <87a5phiap4.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9734"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Stefan Kangas , emacs-devel@gnu.org, Stephen Leake To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jan 08 07:16:23 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 1rMivu-0002Lw-5G for ged-emacs-devel@m.gmane-mx.org; Mon, 08 Jan 2024 07:16:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rMiuq-0003dK-Tl; Mon, 08 Jan 2024 01:15:16 -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 1rMiup-0003cl-6f for emacs-devel@gnu.org; Mon, 08 Jan 2024 01:15:15 -0500 Original-Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rMium-0004c2-MF for emacs-devel@gnu.org; Mon, 08 Jan 2024 01:15:14 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 5AF37240101 for ; Mon, 8 Jan 2024 07:15:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1704694509; bh=9Rkm3jbBRl9AkHKlaC9FhjDhyR85cjE199WTNHDtGsE=; h=From:To:Cc:Subject:Autocrypt:OpenPGP:Date:Message-ID:MIME-Version: From; b=MTji32as+CTkriAx7bK0kmtEibDi4IOQj3t4BPMgfWjbpCdfgQymObEloiwHy6bgx VPkIPBuSiS18QMdQNEYaTJIVW29WS6cRXoBJg5X29OTeoXajF/v5ZuEEtWPbUvUa+c af68VAtlZajCv5NTtuJQUx5NWnfh6IbSka7Ft2ex1xpJrJw9BbccVhX1Tp7TD5H+ik +VuOp8sjwV6DwkCU3SyF8lSOU3hMusz8Jj3tuKxwFSQlEG8Ru5xKzrXobXp3nYMhcL LwyguYlBkedBpGz/Rd8QnD5XAIPaLVb0YnbHEOqKq3V28dE8gDT1y7id38kuqp1N8A ZUF/LZDUI2xgQ== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4T7kLh37Jwz9rxD; Mon, 8 Jan 2024 07:15:08 +0100 (CET) In-Reply-To: (Dmitry Gutov's message of "Sun, 7 Jan 2024 23:27:42 +0200") Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM OpenPGP: id=7126E1DE2F0CE35C770BED01F2C3CC513DB89F66; url="https://keys.openpgp.org/vks/v1/by-fingerprint/7126E1DE2F0CE35C770BED01F2C3CC513DB89F66"; preference=signencrypt Received-SPF: pass client-ip=185.67.36.66; envelope-from=philipk@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -53 X-Spam_score: -5.4 X-Spam_bar: ----- X-Spam_report: (-5.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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:314735 Archived-At: Dmitry Gutov writes: > On 07/01/2024 19:46, Stefan Kangas wrote: >> Dmitry writes: >> >>> On Sun, Jan 7, 2024, at 2:34 PM, Philip Kaludercic wrote: >>>> What I am wondering, is if this simplification were to take place, if it >>>> would be possible to add ada-mode (or ada-ts-mode in that case) back to >>>> the core? >>> What is this fetish of adding everything to the core? >>> ELPA is just one 'M-x package-install' away. >> In Emacs, whatever real work you need to do, it's often the case >> that >> "it's just one M-x package-install" away. > > That's right. It doesn't work for every purpose, though. Not for > infrastructure packages (which we expect to be used by other > packages), nor for features that we want to have enabled by default. > >> I see little reason for that. > > You don't want ELPA to be used? > >> In my ideal world, we should have basic editing support in place in >> Emacs for typical tasks, and packages should provide extensions. Most >> users don't particularly enjoy starting work with installing a bunch of >> extras. > > The way VS Code works and its level of popularity seem to say otherwise. One notable difference is that VS Code prompts users to install the necessary packages, while with Emacs one has to figure out what to install (and how to install it in the case of ada-mode). >> Take a look at how much better things are elsewhere and weep: >> https://github.com/vim/vim/tree/master/runtime/syntax >> Yes, vim is different, their job is easier and so on and so forth. > > It is only better if the features provided in there are reasonably > complete and well-maintained. > > Also note that in no cases Vim bundles advanced completion > functionality of the kind that Ada-mode has. It's much bigger than any > of the files in the above dir. > >> But >> also consider that treesitter modes are looking far easier to maintain >> than some of the behemoths we have sometimes had to write in ELisp. > > And yet the Vim repository doesn't have any tree-sitter integration, > it's all third-party. I don't think we'll see it there anytime soon > (or even in the medium term). I don't know how to check this, but didn't Neovim have built-in tree-sitter support? >> We might not want _all_ language support in Emacs, but for the main >> languages: why would we _not_ want it? While I appreciate the >> importance of workflow related arguments, from the end users point of >> view, it really is a no-brainer which way is better. > > I don't really mind having the major modes for most popular languages > in here, because in those cases the problem of extra traffic is offset > by the advantage that one can see a problem and contribute a fix that > will go out to help a lot of people. Even if I don't use a language in > question myself. But doing that with languages that are unfamiliar to > most contributors, and have small audience, is questionable. > >> This doesn't only apply to prog-modes, but also many text-modes. Take a >> look at toml-ts-mode.el for example, and tell me one reason why it >> shouldn't be in Emacs core. Markdown. YAML. Stuff like that. > > Possible grammar versioning problems. But the above should be small > and stable enough, nor should they require many changes over the > years. I don't think this has to be a problem. Last year I had suggested that `treesit-install-language-grammar' should download release GitHub tarballs, not just clone the repository (which requires Git, and is prone to upstream breakage). >>> And Ada is niche enough that even the argument of having the popular >>> languages supported OOtB doesn't work. >> I think historical context matters here. Ada is not exactly in >> vogue >> these days, but it _is_ supported by GCC, and it has an ISO standard. >> It's not some random novelty language for people that feel that >> Typescript is not edgy enough, or anything like that. >> We also happened to support it in Emacs for ages. > > And it's still there in ELPA, available for everybody to install. > > Note that I don't mean to belittle Stephen's work, nor have any desire > to throw it away, but the sentiment "it's unmaintained, let's bring it > in the core and see what happens" sounds very wrong to me. Just to clarify, my question was what people would think of adding ada-mode back to the core, if it were simplified using tree sitter. > It would be a good idea for the interested parties to pay more > attention to ELPA and improve it there. And if we really want basic > support for Ada in the core, one could extract the "traditional" major > mode from it. Or perhaps start anew and implement the tree-sitter > based mode. Since there is an existing (LSP) language server, Eglot > could be used for the IDE features. And then it would be easier to > compare the feature sets.