From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Theodor Thornhill Newsgroups: gmane.emacs.devel Subject: Re: feature/tree-sitter: Where to Put C/C++ Stuff Date: Tue, 01 Nov 2022 14:05:39 +0100 Message-ID: References: <83pme7cf23.fsf@gnu.org> <878rkv3y7z.fsf@thornhill.no> <83leovc7zr.fsf@gnu.org> <8735b251so.fsf@thornhill.no> <83h6zidfl6.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3113"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org, dev@rjt.dev To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Nov 01 18:19:18 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 1opuuz-0000ZY-GV for ged-emacs-devel@m.gmane-mx.org; Tue, 01 Nov 2022 18:19:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1opqyP-0006Gp-0M; Tue, 01 Nov 2022 09:06:33 -0400 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 1opqyN-0006Fn-M2 for emacs-devel@gnu.org; Tue, 01 Nov 2022 09:06:31 -0400 Original-Received: from out2.migadu.com ([2001:41d0:2:aacc::]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opqyK-00066g-Tn; Tue, 01 Nov 2022 09:06:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1667307984; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5utiZBKw4p7mAHJUo76ICZCxq2UpoqKydMIOCM1w+0c=; b=s+9khng4+mGuq+Vu7p67pxsYgYloag59Bm9pTGsdzwIbcawi14zMT9vvssNsb1VooSRHPO UHkJxau2U5Aj49QJHH4pxmrIvchXHl/Hx/TWDlsowbRGJ/q154CL+H9jDkZuAP8m9ARg/+ xI8XRIVDoWDSyrKV+rjqikEitc+kc8K8GfH6oLi37ZtInH4TkrkYIG6QuvpkFchHK8DXmm Em3PcPxU0b4z9/4vFGDqhIx8w0rtqyRK/kudy5flt5t1/YZ0I3am0i6Wju84SfrctE0oGl Bwsv2gppEga9G9dgCBQZE5yL0WXHMc81+DxXxCi28P07/ZZc/IUWOjmABueHvA== X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. In-Reply-To: <83h6zidfl6.fsf@gnu.org> X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=2001:41d0:2:aacc::; envelope-from=theo@thornhill.no; helo=out2.migadu.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, SPF_HELO_PASS=-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: , Original-Sender: "Emacs-devel" Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:298950 Archived-At: On 1 November 2022 13:28:05 CET, Eli Zaretskii wrote: >> From: Theodor Thornhill >> Cc: emacs-devel@gnu=2Eorg, dev@rjt=2Edev, emacs-devel@gnu=2Eorg >> Date: Tue, 01 Nov 2022 12:53:11 +0100 >>=20 >> > I also have hard time believing that you can reimplement those slow >> > parts of CC Mode to be much faster, but if you have code to show whic= h >> > does that, I'm sure I'd be interested to look at it and consider >> > improving CC Mode using that code=2E >> > >>=20 >> You'd be surprised=2E >>=20 >> - https://github=2Ecom/emacs-csharp/csharp-mode/pull/251 >> - https://github=2Ecom/emacs-csharp/csharp-mode/issues/207 >> - https://github=2Ecom/emacs-csharp/csharp-mode/issues/164 >> - https://debbugs=2Egnu=2Eorg/db/43/43631=2Ehtml >> - https://github=2Ecom/emacs-csharp/csharp-mode/issues/151 >> - https://github=2Ecom/emacs-csharp/csharp-mode/issues/200 >>=20 >> All of these are solved with [0], no implementation needed for anything >> (apart from generic tree-sitter machinery of course)=2E=20 > >That's for C#, not for C/C++=2E > >But if you can do the same for C/C++, sure, let's see the code and >judge its relative merits and demerits=2E > >> >> 3: Confusion with where to file bugs >> > >> > Not relevant in our case: the bugs should be filed with Emacs=2E >> > >>=20 >> Well, are you sure? > >You asked where to file the bugs=2E The answer is: on debbugs=2E If it >eventually turns out the bug is in tree-sitter, we will file a bug >there=2E Just like we do with any other library we use=2E Nothing new >here, IMO=2E > >> > =2E filling and breaking text in comments and strings >> > =2E automatic insertion of newlines after braces, colons, commas, se= mi-colons >> > =2E whitespace cleanups >> > =2E minor modes: electric, hungry-delete, comment-style >> > =2E c-offsets-alist and interactive indentation customization (relat= ed >> > to indentation, but still extremely important, and not directly in >> > tree-sitter) >> > >>=20 >> Yes, I've read the manual many times=2E Filling is one nice thing, >> agreed=2E electric, hungry-delete is just sitting there waiting for us= to >> create a framework using tree-sitter that would benefit _all_ languages >> supported by tree-sitter, not just cc=2E > >If tree-sitter can make these easier or faster or better, I see no >reason not to use tree-sitter for (some of) those features as well=2E >There's no decision to limit tree-sitter's use to fontification and >indentation, and I don't think we will ever make such decisions, >except if we have some bitter experience=2E > >> > As they say, "show me the code"=2E If you can write up a C/C++ mode >> > from scratch which supports most everything in the CC Mode manual, do >> > it better/cleaner than CC Mode does, and do it before the emacs-29 >> > branch is cut, in a month or so, I might change my mind=2E >>=20 >> Challenge accepted=2E Can I create it for java, which is a language I'= m >> writing a lot in these days? > >Sorry, no=2E It has to support all the languages supported by CC Mode >now=2E That's the challenge=2E > Ok let's do it=2E But let's restrict it to languages considered stable fro= m https://tree-sitter=2Egithub=2Eio/tree-sitter/#available-parsers - c - c++ - c# - java - javascript - typescript - json Ok?=20 >It is fine by me to have a separate java-mode, but then I personally >will not be very interested in this, since editing the Emacs C code, >which I do a lot, will still need to use CC Mode=2E Without decent >support for C/C++, CC Mode cannot be retired=2E > >(Do people really use Emacs to develop Java? I'd be surprised=2E) Yes=2E I do, no problem Theo=20