From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: from minnie.tuhs.org (minnie.tuhs.org [IPv6:2600:3c01:e000:146::1]) by inbox.vuxu.org (Postfix) with ESMTP id 4CD832705E for ; Sun, 19 May 2024 18:18:29 +0200 (CEST) Received: from minnie.tuhs.org (localhost [IPv6:::1]) by minnie.tuhs.org (Postfix) with ESMTP id 853EC43AD3; Mon, 20 May 2024 02:18:25 +1000 (AEST) Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by minnie.tuhs.org (Postfix) with ESMTPS id A45B543AD2 for ; Mon, 20 May 2024 02:18:20 +1000 (AEST) Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-1f0937479f8so50627085ad.3 for ; Sun, 19 May 2024 09:18:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716135500; x=1716740300; darn=tuhs.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=pEqDA3IHCQzLKo7ZWJWVoVzg1sNGr/43NGHxq7bl1sg=; b=IejWmole5xd3sRme5im/a57vN3RR7VyX+I7N078IC6bmQv8XYZm1QOtLfxwtrQ0LzY Sw5QZL+OwqVkAq6Tc4CD2Tiy/4gK0JLxC/DwhCdyO7Qut3QjG1fWFABRqeF2kqObjL2E 4f04fuVWQODeACdv1zfNMPTTnQk/z/MoCPXvYptmRzRUIB31Q+k4g2+qREzJKm7Pxj99 XmPCokX0iaEqd5k0Mw0Ghl96OsvTIWDPNZ//j7O9nx2yY79zJx0Pae7OtG3F0o6QcCEs OyQscxL/SL5JYn67zr5MjDYuHZP+KO06LQ3BLKuIdF2nB6erTzDITlRdbdkKMcHNgMUV 0Bdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716135500; x=1716740300; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=pEqDA3IHCQzLKo7ZWJWVoVzg1sNGr/43NGHxq7bl1sg=; b=cTzb3tFzmq5+hdk9evAQKBv7jTL/2sN3+zlGpQ3dwsvcJo3kFSDr686QQRthwwRbOJ 8TutwegZI1VNHaDlXgEbY9o78vxO/LDmFJtqn2P0T6cTZA9/XCPEZsTIbnZohym7GjtA PsGDwZVNIl7CB0sQQUorcXwHh75nc3/8K0TRo7P+2oXHY2n7w2+yFp0iEOkF+YQ7eytl bh+juhUZ73oe9JJc92FfofYVqvkBumL8r0EXKtNLNX7+5/GvfCAqw3SCJJq9tnnPF3bt Twa+/iE6jnE1iKhhZ2sop+pei5VFsOa6QlmV9fPv7cHVHS+bBrN6DE6nY9fKoaOPiXQg zPTA== X-Gm-Message-State: AOJu0YyHiCngYWSCmZZ+u64jJfx4JyiyCDUHomdzXk/16Zwtj1t9N9WS +Tvc5SJiLS+wb3qGmU5JZrQ6WxVjVq3jZPWTAl45P+LPwZDMnUYEQpc6qxKKn0spOI0AyM/ePB0 wkQxrWi9yliu90rOxE6F7dS9dRTRzAQ== X-Google-Smtp-Source: AGHT+IH7i+lhYhdKTkxBymN9sUEeiPhId3Tg8csp4+95mvQem/hwVI7PnJfgLOS5Dnr2JJzlOXd76fSQL0XXdBCkxbo= X-Received: by 2002:a17:90a:4087:b0:2b4:e4d2:b719 with SMTP id 98e67ed59e1d1-2b6cc758cb1mr24148535a91.16.1716135499848; Sun, 19 May 2024 09:18:19 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Paul Winalski Date: Sun, 19 May 2024 12:18:07 -0400 Message-ID: To: Douglas McIlroy Content-Type: multipart/alternative; boundary="000000000000dae7520618d0eee7" Message-ID-Hash: BC6W34ZROETKLW2DVJYSG2FLBZ6AMOLM X-Message-ID-Hash: BC6W34ZROETKLW2DVJYSG2FLBZ6AMOLM X-MailFrom: paul.winalski@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: TUHS main list X-Mailman-Version: 3.3.6b1 Precedence: list Subject: [TUHS] Re: The 'usage: ...' message. (Was: On Bloat...) List-Id: The Unix Heritage Society mailing list Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --000000000000dae7520618d0eee7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, May 19, 2024 at 10:03=E2=80=AFAM Douglas McIlroy < douglas.mcilroy@dartmouth.edu> wrote: > > Another non-descriptive style of error message that I admired was that of > Berkeley Pascal's syntax diagnostics. When the LR parser could not procee= d, > it reported where, and automatically provided a sample token that would > allow the parsing to progress. I found this uniform convention to be at > least as informative as distinct hand-crafted messages, which almost by > definition can't foresee every contingency. Alas, this elegant scheme see= ms > not to have inspired imitators. > > The hazard with this approach is that the suggested syntactic correction might simply lead the user farther into the weeds. It depends on how far the parse has gone off the rails before a grammatical error is found. Pascal and BASIC (at least the original Dartmouth BASIC) have simple, well-behaved grammars and the suggested syntactic correction is likely to be correct. It doesn't work as well for more syntactically complicated languages such as C (consider an error resulting from use of =3D=3D instead= of =3D) or PL/I. And it's nigh on impossible for languages with ill-behaved grammars such as Fortran and COBOL (among other grammatical evils, Fortran has context-sensitive lexiing). Commercial compiler writers avoid this techniq --000000000000dae7520618d0eee7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Sun, May 19, 2024 at 10:03=E2=80=AFAM = Douglas McIlroy <dougla= s.mcilroy@dartmouth.edu> wrote:

Ano= ther non-descriptive style of error message that I admired was that of Berk= eley Pascal's syntax diagnostics. When the LR parser could not proceed,= it reported where, and automatically provided a sample token that would al= low the parsing to progress. I found this uniform convention to be at least= as informative as distinct hand-crafted messages, which almost by definiti= on can't foresee every contingency. Alas, this elegant scheme seems not= to have inspired imitators.

The hazard wi= th this approach is that the suggested syntactic correction might simply le= ad the user farther into the weeds.=C2=A0 It depends on how far the parse h= as gone off the rails before a grammatical error is found.=C2=A0 Pascal and= BASIC (at least the original Dartmouth BASIC) have simple, well-behaved gr= ammars and the suggested syntactic correction is likely to be correct.=C2= =A0 It doesn't work as well for more syntactically complicated language= s such as C (consider an error resulting from use of =3D=3D instead of =3D)= or PL/I.=C2=A0 And it's nigh on impossible for languages with ill-beha= ved grammars such as Fortran and COBOL (among other grammatical evils, Fort= ran has context-sensitive lexiing).

Commercial com= piler writers avoid this techniq
--000000000000dae7520618d0eee7--