From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: Is it better to add treesitter modes to core? Date: Mon, 8 Jan 2024 14:46:36 +0200 Message-ID: <505f644d-235b-4565-978d-8e8cea3e765b@gutov.dev> References: <87a5phiap4.fsf@posteo.net> <871qas8i6s.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13619"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: Stefan Kangas , emacs-devel@gnu.org, Stephen Leake To: Philip Kaludercic Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jan 08 13:48:00 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 1rMp2t-0003Ga-Q0 for ged-emacs-devel@m.gmane-mx.org; Mon, 08 Jan 2024 13:48:00 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rMp1q-0006o0-7t; Mon, 08 Jan 2024 07:46:55 -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 1rMp1h-0006nE-Aa for emacs-devel@gnu.org; Mon, 08 Jan 2024 07:46:45 -0500 Original-Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rMp1f-0001Rd-2z for emacs-devel@gnu.org; Mon, 08 Jan 2024 07:46:44 -0500 Original-Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id D65A95C178E; Mon, 8 Jan 2024 07:46:39 -0500 (EST) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Mon, 08 Jan 2024 07:46:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1704717999; x=1704804399; bh=c8x2zSKAGORTkIhownFtrWYkNWN5c2UWRdWd+WpK4j0=; b= giXRANZzfj9UU2MdBravViZFBBQemwFTTXNTJEN0omi0lVIp1OG3O/oZZm3XC1/9 17cL2ldT+v2dADeVUAqnCHeuC6/NKPdzySOYQWOOLMv63Cuh4+C58oa8wniNlM51 3XqZwyrj+ShvT67AxO4v6JVSpH5PLD+YPcxlBU269Da73f1kpWwhInfyjoWvHRUQ Bd7axxNDpDfHEKsRCyfMSxw/UO8Jc6bBhyGfjONeOnWJMJKt7Uxv2/zLwWvg/upu rytwxYRsmaqDKdOJ7+YaHEUcW8ArAq0N49qIK3xROBJWEzSeSO5mSbzczyfo4PYE QlOzV1G7nSFn4XiffG5rxg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1704717999; x= 1704804399; bh=c8x2zSKAGORTkIhownFtrWYkNWN5c2UWRdWd+WpK4j0=; b=F NQGwhIxN6EToaAc3H4H4PJpoXiKq/zvoS55NJCyXPJplgEpgObWhh/2py9MNtsu/ 3QxDlnW5MxnoSfwoVIvKQHTgq4swd+6D8izgiKJF8fvtfI2agdoQLylZNmY/0DD/ ZQqYCaApKCgmDfDYRjdOhjjXIlPdILkLjPFYIGspSXFb8c6zUESZgXl8z29BZ+Uz riZTbMhkDZSjcMWCz6SVfXS/6xdowFxnEC31eIOmpJXIeiwHwgqqtHDjc+aI70vb 1uDx7C6MIXtJi1lWha4P3QpMhVFBbCkV/HJbxudfNdRR3lZuiFyTjylAWXgfTIgj Fm3uEXGhNat5VMjERTtwQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdehjedggedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepfeekheeuteeigeevledtjeefheefheehjeehkeeuhfeffeelveffleehfefh vdevnecuffhomhgrihhnpehgihhthhhusgdrtghomhenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegumhhithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 8 Jan 2024 07:46:37 -0500 (EST) Content-Language: en-US In-Reply-To: <871qas8i6s.fsf@posteo.net> Received-SPF: pass client-ip=66.111.4.25; envelope-from=dmitry@gutov.dev; helo=out1-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-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:314746 Archived-At: On 08/01/2024 08:15, Philip Kaludercic wrote: >>> 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). We were talking about a feature like that for Emacs too, at some point. Aside from cases like ada-mode, it wouldn't be hard to implement. >> 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? You're thinking of LSP. nvim-treesitter is a separate plugin, with "experimental" in bold in its description. >> 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). It's a problem anyway when the ts mode in the Emacs release that the user has installed is out of sync with whatever grammar release would be downloaded by the above method. These releases can also be sparse and outdated: the last tagged version of tree-sitter-ruby is 0.19 from 3 years ago. There was a version update to 0.20 2 years ago but it's not tagged. And there are useful recent changes as well. >>>> 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. ada-ts-mode might look very different from the current ada-mode. It's unclear which approach the next maintainer of ada-mode is going to take. One of Stephen's outlined alternatives (2) describes reimplementing its own parser on top of tree-sitter (and I'm guessing that he would prefer 2 over 3). That sounds like more work than implementing ada-ts-mode on top of treesit.el like the others. Oh, and speaking of motivated developers. Someone who knows at least a little Ada should check this out: https://github.com/brownts/ada-ts-mode