From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stephen Leake Newsgroups: gmane.emacs.devel Subject: Re: How to add pseudo vector types Date: Sun, 25 Jul 2021 11:44:22 -0700 Message-ID: <86im0y6xo9.fsf@stephe-leake.org> References: <83h7gw6pyj.fsf@gnu.org> <1a776770-50b7-93cd-6591-c9a5b3a56eb8@gmail.com> <8335s64v10.fsf@gnu.org> <5380C92B-6C15-4490-A1E0-1C3132DBB16A@gmail.com> <83k0li2shw.fsf@gnu.org> <83eebq2mpy.fsf@gnu.org> <83lf5w26e3.fsf@gnu.org> <838s1vzp9i.fsf@gnu.org> <83pmv7y6fx.fsf@gnu.org> <83lf5vy58h.fsf@gnu.org> <2EB55126-2CEF-41A7-B5EF-4C3BDF21A034@gmail.com> <83im0zy3mg.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="40764"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (windows-nt) Cc: Yuan Fu , emacs-devel@gnu.org, cpitclaudel@gmail.com, monnier@iro.umontreal.ca To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jul 25 20:45:04 2021 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 1m7j7X-000ALo-VI for ged-emacs-devel@m.gmane-mx.org; Sun, 25 Jul 2021 20:45:04 +0200 Original-Received: from localhost ([::1]:47062 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m7j7V-0000O6-VE for ged-emacs-devel@m.gmane-mx.org; Sun, 25 Jul 2021 14:45:01 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41682) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m7j6z-00083v-1L for emacs-devel@gnu.org; Sun, 25 Jul 2021 14:44:29 -0400 Original-Received: from gateway20.websitewelcome.com ([192.185.65.13]:38955) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m7j6w-0004Or-Iq for emacs-devel@gnu.org; Sun, 25 Jul 2021 14:44:28 -0400 Original-Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway20.websitewelcome.com (Postfix) with ESMTP id EF853400C31A2 for ; Sun, 25 Jul 2021 13:28:29 -0500 (CDT) Original-Received: from host2007.hostmonster.com ([67.20.76.71]) by cmsmtp with SMTP id 7j6umwFp1rJtZ7j6umi2uN; Sun, 25 Jul 2021 13:44:24 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=stephe-leake.org; s=default; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Message-ID:In-Reply-To:Date:References:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=vuRMetrmDI/C/ODKe6twWsP2FKz5GJReAkLjKIFxqwU=; b=IgZMIfviEq2ErEDWdtEu5aT6Rb gdWj/WWRSLPVz6pqoLYzab5k09eXr/rNUGvtYnykqPaLYqzSPTk1m6uym6oytrrQB92sYp/4UJIxt 5Okj30nNUofc9n/X5YZv2UVQpoltjhauBG4r6zxIhWcA8rBUYPh7ozf5xTWdsxfq1+JvxfI9XV5EX WkYjBWvd8HornVaEWyhXac99x1fYxrl23Bfvu5NmfXfSHRICJdqfyqnPglE0RMxFcRUNEfPHkXFVX JD/x26bWz9IO1fRRrj+lcAbB87JzMfdWsV8RGP3bNhtY6fu+o7/EuNtOebqOrM4m2Lft8izGKw6q+ HghUQhsQ==; Original-Received: from [76.77.182.20] (port=57378 helo=Takver4) by host2007.hostmonster.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1m7j6u-001dBI-7c; Sun, 25 Jul 2021 12:44:24 -0600 In-Reply-To: <83im0zy3mg.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 24 Jul 2021 21:21:27 +0300") X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - host2007.hostmonster.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - stephe-leake.org X-BWhitelist: no X-Source-IP: 76.77.182.20 X-Source-L: No X-Exim-ID: 1m7j6u-001dBI-7c X-Source-Sender: (Takver4) [76.77.182.20]:57378 X-Source-Auth: stephen_leake@stephe-leake.org X-Email-Count: 15 X-Source-Cap: c3RlcGhlbGU7c3RlcGhlbGU7aG9zdDIwMDcuaG9zdG1vbnN0ZXIuY29t X-Local-Domain: yes Received-SPF: permerror client-ip=192.185.65.13; envelope-from=stephen_leake@stephe-leake.org; helo=gateway20.websitewelcome.com X-Spam_score_int: 10 X-Spam_score: 1.0 X-Spam_bar: + X-Spam_report: (1.0 / 5.0 requ) DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, SPF_NEUTRAL=0.779 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:271621 Archived-At: Eli Zaretskii writes: >> From: Yuan Fu >> >> when a language=E2=80=99s grammar changes, I don=E2=80=99t think we need= to update >> them often, or ever. And It is not harder than updating >> font-lock-keywords when a language adds a new fancy syntax. > > It isn't an immediate problem, so we can delay it for later. > > However, I do worry about the ability to update this in some > non-manual way. Take for example the way we update our character > databases when Unicode adds more characters/scripts: we use the data > files distributed by the Unicode Consortium If the language concerned has some standard definition that is machine readable, then we could get partway there. But no language standard specifies fontification (or indent), so there is no standard machine-readable description of these. tree-sitter provides a defacto standard for specifying fontification (in the highlight rules files); it would make sense for emacs to be able to read those files directly, along with linking to the corresponding tree-sitter parser. There would have to provide a separate mapping from tree-sitter notation to emacs font names.=20 wisi provides a mechanism to describe fontification and indentation in the grammar source file; every time ISO releases a new Ada language version, I have to compare them and incorporate the changes. I've written code to partly automate this (the language reference manual contains the grammar in a variant of EBNF in an appendix, which is mostly machine-readable), but it's highly Ada specific, and still mostly a manual process. Fortunately it only happens every 10 years for Ada :). Many languages provide some EBNF description of the language, but it is often in a form that is not suitable for whatever parser generator you are using; it is usually optimized for human understanding. I made it a requirement for the wisi parser generator to use the Ada reference grammar as closely as possible, but I still have to modify the grammar to get reasonable performance. You can find many different Java grammars on the web, optimized for different parser generators (there are two different but nominally equivalent grammars in the Java docs). -- -- Stephe