Path: csiph.com!weretis.net!feeder6.news.weretis.net!news.misty.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end From: gah4 Newsgroups: comp.compilers Subject: Re: syntax complexity Date: Thu, 16 Feb 2023 11:33:01 -0800 (PST) Organization: Compilers Central Sender: johnl@iecc.com Approved: comp.compilers@iecc.com Message-ID: <23-02-050@comp.compilers> References: <23-02-045@comp.compilers> <23-02-047@comp.compilers> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="14917"; mail-complaints-to="abuse@iecc.com" Keywords: syntax, comment Posted-Date: 16 Feb 2023 17:46:21 EST X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com In-Reply-To: <23-02-047@comp.compilers> Xref: csiph.com comp.compilers:3389 On Thursday, February 16, 2023 at 9:57:53 AM UTC-8, Hans-Peter Diettrich wrote: > On 2/16/23 12:08 AM, gah4 wrote: (snip) > > One complication I see, is that syntax complexity as seen by people, > > might be different from it as seen by programs. > How do programs recognize syntax complexity? > Number of rules and exceptions? When I wrote that one, I was thinking about the places where Fortran uses special characters and PL/I uses words. DO I=1,10,3 DO I = 1 TO 10 BY 3; I think about them in a different way, such that the thought complexity is different. A compiler doesn't "think" in that way. I suppose I agree with the above, the length of the standard, with some assumptions on how it is written, or the length of the front end. [Having written a couple of Fortran parsers, I can say that while the hacks to deal with ignored spaces were ugly, they weren't that hard. PL/I has a separate issue that the same token might be a keyword or a variable depending on context, and the kinds of parsers you build with bison et al don't deal very well with that. -John]