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.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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 892082494E for ; Mon, 20 May 2024 01:08:41 +0200 (CEST) Received: from minnie.tuhs.org (localhost [IPv6:::1]) by minnie.tuhs.org (Postfix) with ESMTP id C95BF43328; Mon, 20 May 2024 09:08:34 +1000 (AEST) Received: from mail-vk1-xa2d.google.com (mail-vk1-xa2d.google.com [IPv6:2607:f8b0:4864:20::a2d]) by minnie.tuhs.org (Postfix) with ESMTPS id A0A5743327 for ; Mon, 20 May 2024 09:08:28 +1000 (AEST) Received: by mail-vk1-xa2d.google.com with SMTP id 71dfb90a1353d-4df37a78069so1043163e0c.1 for ; Sun, 19 May 2024 16:08:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dartmouth.edu; s=google1; t=1716160107; x=1716764907; darn=tuhs.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=EUhRXeG5+BwQv9b4uiHY1uZo3dW9WjQyR5ux0+A3iHw=; b=iX5Fz2HTZb5/WiWktl1lgdCDHj3wBhtuaveswHUxSqZk2eI/qbwKzMQ8dj4NbnGRDi tbhVZoWcrj8gDbIgRZuqcrwM0auzZkBLM3fc+yXFhQCDjmuJuW3NqDyGmEuvUOIj5SnH 5Dm5eoi8KZ46C1ImrlNleksc1gSeQ9BnlAkm/nw6Cl07DQeunz7KDgNNrwXNj6zmTMGU 0Pr75VxyZMSKQ26b485KnmCVJt5ORmUuKRh1jSDU+3Mhbll/RJhkftXDxzmU0b0kKplO 6TQeTYoOwtSN9Q7ny/Sc9RyCvq0g6Tp7sFIjB3q6ei5T6FRlFR+6VZ09G8Jf5ipSrY9T qCtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716160107; x=1716764907; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=EUhRXeG5+BwQv9b4uiHY1uZo3dW9WjQyR5ux0+A3iHw=; b=j+jKmzWAMfMydsAALehSBbqz7u9OFrPoJLwgflwXPIwWOVmtUh42qbDLH6ooTSouEK ukoWCeKy6bHxVWjQaSWdfymA72uTLSNyeTGmrnt/HgNMSb5vSv43TtfeaGqPyZkwfT2y jtwUXnvJcyFL1EPwBI5gxNlJ9RPLa2dRapyFs0dXku+fzuX2M/lOB6XBP7JMaP0tcWXd 9jhMgRilRoUoAe6UqUk1u/w3r7lPuWFqm5N5267Lg2tHm9vP9PN7w3jxaPGft3s7dz55 XNhjKvhaCbNFZiBQKubr+8gD+GITswSWstGxB5N49jCou9eg32UiUmRPidX7avarOyxu t1Nw== X-Gm-Message-State: AOJu0Ywvxwj4H00hsBegxaJyhOeGnNxVLniONsLbkeTYGovtxf11MjyN IfhQDbni8YxLrlEvdBgfeJvaAc9xwcgb2SbJpqENfi7J6moScz3nxvD/d8NyHSqZRRml8KMy8Vl 2swUTjvwHkdaTkOHzroNCKRwalD9SXboL+pshTFjpPZaKLEtULO4= X-Google-Smtp-Source: AGHT+IHgoYYCWBP354qPAMIWoY/v8oGpkHZ51EeOi+/cpS2KZZy+WLepKhkbMNL23VR+nUAYxrOvlDZ9eAZq5ibk1YE= X-Received: by 2002:a05:6102:e09:b0:47b:fe0b:a92e with SMTP id ada2fe7eead31-48077de2bbbmr26744365137.16.1716160107286; Sun, 19 May 2024 16:08:27 -0700 (PDT) MIME-Version: 1.0 From: Douglas McIlroy Date: Sun, 19 May 2024 19:08:12 -0400 Message-ID: To: TUHS main list Content-Type: multipart/alternative; boundary="00000000000092b5e40618d6a913" Message-ID-Hash: 7N4LNXENEZYPISLMFSBOJKKH2CEBQBBB X-Message-ID-Hash: 7N4LNXENEZYPISLMFSBOJKKH2CEBQBBB X-MailFrom: douglas.mcilroy@dartmouth.edu 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 X-Mailman-Version: 3.3.6b1 Precedence: list Subject: [TUHS] 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: --00000000000092b5e40618d6a913 Content-Type: text/plain; charset="UTF-8" >> Another non-descriptive style of error message that I admired was that >> of Berkeley Pascal's syntax diagnostics. When the LR parser could not >> proceed, 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 seems 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 I don't think there's enough experience to justify this claim. Before I experienced the Berkeley compiler, I would have thought such bad outcomes were inevitable in any language. Although the compilers' suggestions often bore little or no relationship to the real correction, I always found them informative. In particular, the utterly consistent style assured there was never an issue of ambiguity or of technical jargon. The compiler taught me Pascal in an evening. I had scanned the Pascal Report a couple of years before but had never written a Pascal program. With no manual at hand, I looked at one program to find out what mumbo-jumbo had to come first and how to print integers, then wrote the rest by trial and error. Within a couple of hours I had a working program good enough to pass muster in an ACM journal. An example arose that one might think would lead "into the weeds". The parser balked before 'or' in a compound Boolean expression like 'a=b and c=d or x=y'. It couldn't suggest a right paren because no left paren had been seen. Whatever suggestion it did make (perhaps 'then') was enough to lead me to insert a remote left paren and teach me that parens are required around Boolean-valued subexpressions. (I will agree that this lesson might be less clear to a programming novice, but so might be many conventional diagnostics, e.g. "no effect".) Doug --00000000000092b5e40618d6a913 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
>> Another non-descriptive style of error message that = I admired was that
>> of Ber= keley Pascal's syntax diagnostics. When the LR parser could not<= br style=3D"color:rgb(80,0,80)">>> proceed, it reported where, and = automatically provided a sample token
>> that would allow the parsing to progress. I found this uniform=
= >> convention to be at leas= t as informative as distinct hand-crafted
>> messages, which almost by definition can't foresee eve= ry contingency.
>> Alas, thi= s elegant scheme seems not to have inspired imitators.

>=C2=A0The hazard wit= h this approach is that the suggested syntactic correction
> might simply lead the user farther into the weeds

I don&= #39;t think there's enough experience to justify this claim. Before I e= xperienced the Berkeley compiler, I would have thought=C2=A0such bad outcom= es were inevitable in any language.=C2=A0Although the compilers' sugges= tions often bore little or no relationship to the real correction,=C2=A0 I = always found them informative. In particular, the utterly consistent style = assured there was never an issue of ambiguity or of technical jargon.
=

The compiler taught me Pascal in an evening. I had scan= ned the Pascal Report a couple of years before but had never written a Pasc= al program. With no manual at hand, I looked at one program to find out wha= t mumbo-jumbo had to come first and how to print integers, then wrote the r= est by trial and error. Within a couple of hours=C2=A0 I had a working prog= ram good enough to pass muster in an ACM journal.

= An example arose that one might think would lead "into the weeds"= . The parser balked before 'or' in a compound Boolean expression li= ke=C2=A0 'a=3Db and c=3Dd or x=3Dy'. It couldn't suggest a righ= t paren because no left paren had been seen. Whatever suggestion it did mak= e (perhaps 'then') was enough to lead me to insert a remote left pa= ren and teach me that parens are required around Boolean-valued subexpressi= ons. (I will agree that this lesson might be less clear to a programming no= vice, but so might be many conventional diagnostics, e.g. "no effect&q= uot;.)

Doug

=
--00000000000092b5e40618d6a913--