From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lynn Winebarger Newsgroups: gmane.emacs.devel Subject: Re: Why tree-sitter instead of Semantic? (was Re: CC Mode with font-lock-maximum-decoration 2) Date: Tue, 16 Aug 2022 12:33:57 -0400 Message-ID: References: <83o7wuva9o.fsf@gnu.org> <83mtceupbx.fsf@gnu.org> <83lerxvfnu.fsf@gnu.org> <838rnxvdcq.fsf@gnu.org> <83r11ptksn.fsf@gnu.org> <83a68dti6w.fsf@gnu.org> <87a687sjnv.fsf@yahoo.com> <83zgg4fm9p.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="16027"; mail-complaints-to="usenet@ciao.gmane.io" Cc: luangruo@yahoo.com, jostein@secure.kjonigsen.net, jostein@kjonigsen.net, acm@muc.de, emacs-devel@gnu.org, casouri@gmail.com To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Aug 16 18:37:24 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 1oNzZD-0003xa-RA for ged-emacs-devel@m.gmane-mx.org; Tue, 16 Aug 2022 18:37:23 +0200 Original-Received: from localhost ([::1]:34450 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oNzZC-0000LU-Ug for ged-emacs-devel@m.gmane-mx.org; Tue, 16 Aug 2022 12:37:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52150) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oNzWA-0006fu-Da for emacs-devel@gnu.org; Tue, 16 Aug 2022 12:34:14 -0400 Original-Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]:45031) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oNzW8-0001PI-Ee; Tue, 16 Aug 2022 12:34:13 -0400 Original-Received: by mail-pf1-x435.google.com with SMTP id h28so9765832pfq.11; Tue, 16 Aug 2022 09:34:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc; bh=O6h5fxclnzYAZX0TMeHjdavHCAeG8KibMonZUZFd91E=; b=iTVhBrGFKqINA/3mFGngskp/5kQfbAZmOfLBt0ODFRIDwkWeKTJrgnfRYtCJwXBZ1s McMEjz+4yf3Xk0t/GN0SAeUnxWtj/pttxvXDD5yFfeu7djdm9D/+Z0/zowKSgGE0VxPE C32fb92C2ZDToiV5l6IzOPtNe+oLqC9b5m6jRR7KFwpjV/Pqshf1/C/hiwTtXJz+v9Ql RHN1vKz6ag2pSYEMYlyy5I++er33dF1wdojWJ0VWZK93hB4/hr/W8wi7K8fkQHj2LwTr MUnSwpVtW99toFkiX5FlEokgNqw4n8K8Quu6Y2832MElrVrdGQcpvBeYfehmLMuzNZGf UdAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc; bh=O6h5fxclnzYAZX0TMeHjdavHCAeG8KibMonZUZFd91E=; b=sk2Ju84TAierZYjay261+e1rXOkvdiU9ea8U5YdfbN76ngLKaaHhJVAPuOnKtriBCJ 2fdxfPmhSHhOKO//a0aX4Y/ctUE3tHiMALJOnJXUOr2GedoDao+so6YXY2i5mubL0pmQ DskwjQy6q33bVBCerzeuBgBKIRMCW7ZF86PDYv5/cAr4NzUUoiqo/3umD1KMPQrmHAOT CbPhLz65hU+SIl2uiCkvDui1hV/rmxqczMWTr4YE4udfT6TIFcHFg/dJVB1am8SkbRP0 x63s4qdKde3AkQFSdfqLVxEJri5pmOd2iYv2tFwrFBha9+x2d0BXfSZN4vfmaHKfyaOz N2fA== X-Gm-Message-State: ACgBeo1r8cdoQzHkguR18ca+dvp328IyPMVSQTPSMnWbumMsmcIvvh+b GsNXqoGhmje4w7ufBipEO+jR8cG2Su9WwqKN3CdkTbSkTMXKng== X-Google-Smtp-Source: AA6agR7CPXaWXe4V5HSCEJ9s3WlX8c5AWccWsAHDbTr3nyHWKRFHqpRP+EUd7/dniQsi6KEIsm2YNz2udkFgnr2ibH8= X-Received: by 2002:a63:2d1:0:b0:41d:9a9e:f2ae with SMTP id 200-20020a6302d1000000b0041d9a9ef2aemr18016301pgc.488.1660667650045; Tue, 16 Aug 2022 09:34:10 -0700 (PDT) In-Reply-To: <83zgg4fm9p.fsf@gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::435; envelope-from=owinebar@gmail.com; helo=mail-pf1-x435.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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" Xref: news.gmane.io gmane.emacs.devel:293508 Archived-At: On Tue, Aug 16, 2022 at 7:42 AM Eli Zaretskii wrote: > > From: Lynn Winebarger > > Date: Tue, 16 Aug 2022 05:06:58 -0400 > > Cc: Jostein Kj=C3=B8nigsen , > > Eli Zaretskii , jostein@kjonigsen.net, Alan Mackenz= ie , > > emacs-devel , Yuan Fu > > > > On Sat, Aug 13, 2022 at 9:23 PM Po Lu wrote: > > > > > > Jostein Kj=C3=B8nigsen writes: > > > > > > That's not true. If you enable Semantic and EDE, and add system > > > includes (with semantic-add-system-include), and wait for the initial > > > parse to finish after visiting a file in a project, it becomes > > > immediately useful for editing C code. It's actually what I use for = my > > > day job. > > > > I think what Jostein means is - how would you know you need to take > > all those steps? > > As usual: by reading the fine documentation. Amazingly enough, > Semantic does have an Info manual, which comes with Emacs, and those > steps are documented there. > > More generally: Semantic's problems, issues, and disadvantages aside, > let's not pretend that Emacs maintainers are incompetent. When the > decision was made to add parts of Semantic to Emacs core, back in > Emacs 23 days, a lot of effort went into its proper integration, > including making its documentation available. So if someone asks > him/herself how do I use this stuff, I expect that someone to make the > minimal effort of reading the available documentation and trying to > follow it. If that doesn't work, then yes, by all means do complain. I'm only saying there's a disconnect between Jostein's report and Po's response. It's probably a UI issue. There's a checkbox in a dropdown menu that says "Source Code Parsers (Semantic)". That probably suggests to the casual user that all they have to do is check the box to get the full benefit. Or that if they need to do more configuration, clicking the box will lead to a process to do the configuration. Whether that's a reasonable expectation on the user's part, I couldn't say. That said, as a developer there are some missing pieces in the Semantics docs. For one, some of the texi files - particularly the ones for the grammar framework and language dev, did not make it into the emacs source tree, though there are still dangling references to those documents. I went to the last (circa 2014) version of CEDET from sourceforge and grabbed the corresponding docs from there. I will say one of my disappointments with the Semantic grammar framework (once I grabbed those grammar-fw and langdev docs) is that the lexers rely on the syntax tables to identify blocks. Unfortunately, that is one of the limitations I had hoped to overcome by using Semantic. For example, * "${" and "{" could both open a block closed by "}" * if/fi, case/esac, etc, or possibly all keyword blocks are closed by "end= " * "variadic" structures like try/catch+/finally? It's not clear from the doc just how much this reliance on the syntax table based block identification is baked into the lexer/parser generation. Lynn