From mboxrd@z Thu Jan 1 00:00:00 1970 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_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 26172 invoked from network); 10 Mar 2023 18:04:08 -0000 Received: from minnie.tuhs.org (50.116.15.146) by inbox.vuxu.org with ESMTPUTF8; 10 Mar 2023 18:04:08 -0000 Received: from minnie.tuhs.org (localhost [IPv6:::1]) by minnie.tuhs.org (Postfix) with ESMTP id DDA0B4158D; Sat, 11 Mar 2023 04:04:05 +1000 (AEST) Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by minnie.tuhs.org (Postfix) with ESMTPS id C507141585 for ; Sat, 11 Mar 2023 04:04:01 +1000 (AEST) Received: by mail-lf1-x131.google.com with SMTP id bi9so7711262lfb.2 for ; Fri, 10 Mar 2023 10:04:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678471439; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=4ekMoyOCyEEjzE7WD87sEQHoxsDEkwsU+FwI4NXg/Jk=; b=n/Oy+qEi8Xk+/4CdY+2FKwTVp95iNfYKryhQpkNKwb39qfbJyZkp3ZkYAwA40uIGIc f5GOX7OjPW862l1gP+kHTHovfaeS1tummAuZ0a31LX1OqPoQD+pYTvFQX8r33Jyuz41F sp45WMAsQBaxXr9Y9Vs2Wecf6Nrtoo3uDzgCyEwidGzHZaS8R9eZ7dVqAIhckcpNTIPu tukFx6PjtpNoIbI1AQpFFdFUJa7S1RobkVxyODdRjD2clO0jGCnpyI+S7Q0ViVgiFH44 WLrVjp63zMkhlkwaAYpbJ+aXW0vWMcapls8kkUFreUr6BukSszISd0N/Q86DECqR/1B8 10Hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678471439; h=content-transfer-encoding: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=4ekMoyOCyEEjzE7WD87sEQHoxsDEkwsU+FwI4NXg/Jk=; b=5H7mdJIiQYyqv4ILcx53vCVrHkJruyDWLGhyWImQW6H9IAGEtHP6HYSXuJf6lqXyBO cYuVc+sYI+2EyZgpvQbfWF/Gz5riOxURGAkn7djW7uKlYke0Hwh/ytGOFEeiqJ+f0mAm swXAu6j6gc/DSFxU+d4tYjcaCXFHVc105+h0K9G0Uu2/dXOccJXv5GMGDiJvA+HwONjc u9h3alMsSkBWmJBn2My1SmURq2qOL4So8qj/pLuPkov9EyL2ZYrJwj3fjVp99T5iYuTA XMAhOPgIJ/uedoaeFafYU806TBkIT2gC3Xao01Z3Gn8QH6YUj073ypsbu/acDYzWTB9K wHGQ== X-Gm-Message-State: AO0yUKWGTaqTg941C9IkuzZ+avpAkKoZHojc1QOCVUT66yENFXV9UOWi UwXpLErpWELfAQn3XShVFrbvdpXnujUAaUjaJtOKtLja X-Google-Smtp-Source: AK7set9aVneTGzSf3oIEfgFAAg9FBXWCSPI1gHIcwu8VQN3PCFKudAXbHz34h01usYJ5sYrWGEKWxPJIDqz0INcbGuE= X-Received: by 2002:a05:6512:20d:b0:4d5:ca43:7047 with SMTP id a13-20020a056512020d00b004d5ca437047mr8176364lfo.10.1678471439223; Fri, 10 Mar 2023 10:03:59 -0800 (PST) MIME-Version: 1.0 References: <69248852-1701-4938-8A4D-3B27F3018E83@iitbombay.org> In-Reply-To: <69248852-1701-4938-8A4D-3B27F3018E83@iitbombay.org> From: Dan Cross Date: Fri, 10 Mar 2023 13:03:23 -0500 Message-ID: To: Bakul Shah Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Message-ID-Hash: AAQ3QHSWD2MMUNRZ4DMPVBRKHBE3X2JQ X-Message-ID-Hash: AAQ3QHSWD2MMUNRZ4DMPVBRKHBE3X2JQ X-MailFrom: crossd@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: segaloco , coff@tuhs.org X-Mailman-Version: 3.3.6b1 Precedence: list Subject: [COFF] Re: [TUHS] Re: Conditions, AKA exceptions. (Was: I can't drive 55: "GOTO considered harmful" 55th anniversary) List-Id: Computer Old Farts Forum Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Fri, Mar 10, 2023 at 12:36=E2=80=AFPM Bakul Shah w= rote: > During development the runtime should simply invoke a debugger in this ca= se. This should be perfectly doable but for some reason it is considered ac= ceptable to crash a program! I don=E2=80=99t want to run a program *under a= debugger* but want it invoked at the right time! Common Lisp implementations have been doing that for years! Too bad using Lisp means bringing all the rest of the Lisp stuff with it, including the attitude. Oh well. :-) - Dan C. > On the flip side something I've always thought would be powerful, at leas= t in development, is a way to tell any and all procedures being called to i= gnore their exception/condition handling and hard-crash. Of course you don'= t want to take that kind of hammer to a production situation, but a way to = override any and all handling so that real errors become apparent would be = incredibly nice. > > If nothing else, I could provide much better stack traces to vendors when= I'm particularly stuck on something and convinced it isn't my fault. Maybe= such a thing exists in C# but I've never gone looking for it, all I know i= s catching an exception from some vendor library with zero useful informati= on makes me want to take a hammer to much more than the code... > > - Matt G. > ------- Original Message ------- > On Friday, March 10th, 2023 at 9:11 AM, Bakul Shah = wrote: > > =EF=BB=BFTo make exceptional handling robust, I think every exception nee= ds to be explicitly handled somewhere. If an exception not handled by a fun= ction, that fact must be specified in the function declaration. In effect t= he compiler can check that every exception has a handler somewhere. I think= you can implement it using different syntactic sugar than Go=E2=80=99s obn= oxious error handling but basically the same (though you may be tempted to = make more efficient). > > On Mar 10, 2023, at 6:21 AM, Larry Stewart wrote: > > =EF=BB=BFTLDR exceptions don't make it better, they make it different. > > The Mesa and Cedar languages at PARC CSL were intended to be "Systems Lan= guages" and fully embraced exceptions. > > The problem is that it is extremely tempting for the author of a library = to use them, and equally tempting for the authors of library calls used by = the first library, and so on. > At the application level, literally anything can happen on any call. > > The Cedar OS was a library OS, where applications ran in the same address= space, since there was no VM. In 1982 or so I set out to write a shell fo= r it, and was determined that regardless of what happened, the shell should= not crash, so I set out to guard every single call with handlers for every= exception they could raise. > > This was an immensely frustrating process because while the language sugg= ested that the author of a library capture exceptions on the way by and tra= nslate them to one at the package level, this is a terrible idea in its own= way, because you can't debug - the state of the ultimate problem was lost.= So no one did this, and at the top level, literally any exception could o= ccur. > > Another thing that happens with exceptions is that programmers get the br= ight idea to use them for conditions which are uncommon, but expected, so a= ny user of the function has to write complicated code to deal with these ca= ses. > > On the whole, I came away with a great deal of grudging respect for ERRNO= as striking a great balance between ease of use and specificity. > > I also evolved Larry's Theory of Exceptions, which is that it is the prog= rammer's job to sort exceptional conditions into actionable categories: (1)= resolvable by the user (bad arguments) (2) Temporary (out of network socke= ts or whatever) (3) resolvable by the sysadmin (config) (4) real bug, resol= vable by the author. > > The usual practice of course is the popup "Received unknown error, OK?" > > -Larry > > On Mar 10, 2023, at 8:15 AM, Ralph Corderoy wrote= : > > > =EF=BB=BFHi Noel, > > > if you say above that most people are unfamiliar with them due to > > their use of goto then that's probably wrong > > > I didn't say that. > > > Thanks for clarifying; I did know it was a possibility. > > > I was just astonished that in a long thread about handling exceptional > > conditions, nobody had mentioned . . . exceptions. Clearly, either > > unfamiliarity (perhaps because not many laguages provide them - as you > > point out, Go does not), or not top of mind. > > > Or perhaps those happy to use gotos also tend to be those who dislike > > exceptions. :-) > > > Anyway, I'm off-TUHS-pic so follow-ups set to goto COFF. > > > -- > > Cheers, Ralph. > > >