From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Call for volunteers: add tree-sitter support to major modes Date: Mon, 17 Oct 2022 18:47:34 +0000 Message-ID: References: <83czb1jrm3.fsf@gnu.org> <878rlo7on0.fsf@thornhill.no> <83k04y1gd2.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26409"; mail-complaints-to="usenet@ciao.gmane.io" Cc: casouri@gmail.com, theo@thornhill.no, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Oct 17 20:49:49 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 1okVBM-0006aG-DT for ged-emacs-devel@m.gmane-mx.org; Mon, 17 Oct 2022 20:49:48 +0200 Original-Received: from localhost ([::1]:52536 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1okVBL-00054W-8S for ged-emacs-devel@m.gmane-mx.org; Mon, 17 Oct 2022 14:49:47 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42144) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okV9I-0003XU-0D for emacs-devel@gnu.org; Mon, 17 Oct 2022 14:47:41 -0400 Original-Received: from mx3.muc.de ([193.149.48.5]:11586) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okV9F-0005fr-V4 for emacs-devel@gnu.org; Mon, 17 Oct 2022 14:47:39 -0400 Original-Received: (qmail 52490 invoked by uid 3782); 17 Oct 2022 20:47:35 +0200 Original-Received: from acm.muc.de (p4fe15a04.dip0.t-ipconnect.de [79.225.90.4]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Mon, 17 Oct 2022 20:47:35 +0200 Original-Received: (qmail 6658 invoked by uid 1000); 17 Oct 2022 18:47:34 -0000 Content-Disposition: inline In-Reply-To: <83k04y1gd2.fsf@gnu.org> X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de Received-SPF: pass client-ip=193.149.48.5; envelope-from=acm@muc.de; helo=mx3.muc.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, 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" Xref: news.gmane.io gmane.emacs.devel:297978 Archived-At: Hello, Eli. On Mon, Oct 17, 2022 at 20:59:05 +0300, Eli Zaretskii wrote: > > Date: Mon, 10 Oct 2022 19:44:40 +0000 > > Cc: Theodor Thornhill , Eli Zaretskii , > > emacs-devel > > From: Alan Mackenzie > > > I think we can use the same major mode, just skip the cc-mode > > > initialization and only enable tree-sitter stuff if > > > java-use-tree-sitter is true. But I want to know Alan’s thought on > > > this. I included him in CC. > > Thanks! At the moment, I'm still trying to get a handle on what > > tree-sitter is and can do. The idea of including lots of tree-sitter > > modes in Emacs 29 came up very suddenly over the weekend. > Alan, any progress in that direction? Do you have any thoughts to > share? Generally, that the replacement of CC Mode's engine with tree-sitter is a good idea; CC Mode as it currently is is too much work to maintain, and in the long run is unsustainable. At the same time, I have no idea how good tree-sitter's grammars for CC Mode's modes are. If I understand rightly, a call to TS requires start and end buffer positions to be calculated by Emacs rather than TS itself. This might reduce some of the expected speed gain. I would like to keep all of CC Mode's user features in the new mode, if at all possible. I don't know how easy it will be, for example, to keep CC Mode's indentation styles working in the new mode. I can't honestly see myself as able to integrate tree-sitter into CC Mode in the short time before the planned pre-test of Emacs 29. I think we should take up the offer made by João Paulo Labegalini de Carvalho on 2020-10-11 to work on C Mode and possibly C++ Mode. I'm afraid I've only read a small part of this thread on emacs-devel, so there's likely quite a bit of relevant stuff I've missed. > TIA -- Alan Mackenzie (Nuremberg, Germany).