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_INVALID,DKIM_SIGNED, HTML_MESSAGE,MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 8113 invoked from network); 10 Mar 2023 01:09:14 -0000 Received: from minnie.tuhs.org (2600:3c01:e000:146::1) by inbox.vuxu.org with ESMTPUTF8; 10 Mar 2023 01:09:14 -0000 Received: from minnie.tuhs.org (localhost [IPv6:::1]) by minnie.tuhs.org (Postfix) with ESMTP id A2D8841399; Fri, 10 Mar 2023 11:09:09 +1000 (AEST) Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by minnie.tuhs.org (Postfix) with ESMTPS id 29D8141396 for ; Fri, 10 Mar 2023 11:09:04 +1000 (AEST) Received: by mail-ed1-x530.google.com with SMTP id ay14so14270622edb.11 for ; Thu, 09 Mar 2023 17:09:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; t=1678410542; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=uu/F9kvIYCyeRsGbVTOLW4Jtc94k+1QgcJyBWk2pAg0=; b=vddfmf2zdMfsgz1gp6rCIzTml2HRndR1cv+0jtzBbqv+PsuVe4OG87BYFF/MK2i9wE /pIfiDEXIDFkRiNenbJS40bJAZf7T6CJbzbBB9jdpGsN3I/en2NsF8TJsyHhyTjTJTZk 7OczRuvLoUv1jqtTtTCET0dj9T80sThpTwWq8U5DBmEkGhUUV0deXGReUjCg5oNwcgQT AccPJLsCES6lsvENsh36cBaXQkv9FO2cZTorCHUoVSyX4z/5WKwjG6J+KasTpjVWEYUn adIs3xb+epTUk2pEn5/8TmDaZLJO3ROuECAXV70M9H9H3RVusn1KHpDa0xtmA4zwyFe5 WU2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678410542; 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=uu/F9kvIYCyeRsGbVTOLW4Jtc94k+1QgcJyBWk2pAg0=; b=Z7NZFjZUO9jAsYzcRbUf56x8UrcIRmtmsq7CvuQtH19ziRbCMuxklSCUqRPU41DKo3 0Lix4VySf19eTujt0sbQWM4gU71+QBVX19cPdxLlvswOIGhLvL/J6n0MNep9H++zuwA+ 9t8KRH+sMPypzgbGL5ems+/qdy8T4IcALM4cE5j33aUaXazjkWB8vxu8F+keJ4ixPJ2S FJ/6hWzojrJzwQKqIaXfh3BSmuBYqyYrXf5wvqOxOVddXrj9cjThvTXwWDhlCquM3oBo /hg/Hx1Om/WC6R7lYW9ETEVsjO6VYBEz+3eTzac/msMMkfjgSXbD7ZMkhqKMpkKGpNZc 8xUA== X-Gm-Message-State: AO0yUKX7DsORqstP8QkEMS+AfpvDBBRejB69KN11wxAShAIDUOnG2u9b 6OqjRsY5urQ25qbWag+/VE0fz8JQC4yBfiQmUCgtk61SZReHlkma X-Google-Smtp-Source: AK7set9uZrYvMdfiXewdVvN5P/6ar8QYE67GXjtdoV/Hspw6Mv+kNRgSufNXi//kGoLGUM9d3skz55cBdqqX21WQVjw= X-Received: by 2002:a17:906:64d:b0:8d1:57cf:ef3c with SMTP id t13-20020a170906064d00b008d157cfef3cmr11729249ejb.2.1678410542021; Thu, 09 Mar 2023 17:09:02 -0800 (PST) MIME-Version: 1.0 References: <20230309230130.q4I-f%steffen@sdaoden.eu> <849f8da7-8df2-619c-6080-d40d0ef6fc57@makerlisp.com> In-Reply-To: From: Warner Losh Date: Thu, 9 Mar 2023 17:08:50 -0800 Message-ID: To: segaloco Content-Type: multipart/alternative; boundary="00000000000025130305f6816889" Message-ID-Hash: YTS5QFPCBMPXNFJC4H7SD3ZYGV2LVHZW X-Message-ID-Hash: YTS5QFPCBMPXNFJC4H7SD3ZYGV2LVHZW X-MailFrom: wlosh@bsdimp.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: The Eunuchs Hysterical Society X-Mailman-Version: 3.3.6b1 Precedence: list Subject: [TUHS] Re: I can't drive 55: "GOTO considered harmful" 55th anniversary List-Id: The Unix Heritage Society mailing list Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --00000000000025130305f6816889 Content-Type: text/plain; charset="UTF-8" On Thu, Mar 9, 2023, 5:55 PM segaloco wrote: > I guess I hadn't considered deeply nested loops. I contort myself into a > mental pretzel figuring out how to avoid GOTOs sometimes, maybe I could > stand to embrace one every once in a while myself... > Yea. I recall a proposal to add break label; and the label could only be at the end of a loop. The objection was why bloat the compiler with another goto... I developed my restricted lack of fear after a stint in Java with its multilevel break... Warner Now doing some research, more languages support GOTO than I thought, > including C#, PHP, even Rust for all its safety orientation appears to at > least muster a GOTO-ish construct. If people keep doing it, it must still > be wanted, needed, and useful. I stand corrected on my never-GOTO attitude. > Now to slip a GOTO into a work project and see how long it takes to get > chastised :) > > - Matt G. > ------- Original Message ------- > On Thursday, March 9th, 2023 at 3:54 PM, Warner Losh > wrote: > > Oh also sometimes for breaking out of multiple levels of while/for loops. > The alternatives are often worse. > > Warner > > On Thu, Mar 9, 2023, 4:31 PM Luther Johnson wrote: > >> I agree, unless I use setjmp/longjmp for that. Besides error recovery, >> there are occasionally other times when we want to locally "return" to a >> common state and start "from the top" again. I find such uses very clear in >> their intent, and if commented well, not hard to follow at all - as long as >> there is not more than one "top" :) >> On 03/09/2023 04:21 PM, Warner Losh wrote: >> >> >> >> On Thu, Mar 9, 2023, 4:18 PM segaloco via TUHS wrote: >> >>> GOTO is one of those paradoxical things where I would only trust the >>> most sophisticated engineer to know when it's acceptable to use a GOTO but >>> on the flip side would be suspicious of anyone claiming to be an engineer >>> that uses any amount of GOTOs... >>> >>> Were any of the various GOTOs in languages ever meant to be any more >>> than providing the same level of control that branch statements in assembly >>> do? Was there ever some vision anyone's aware of concerning a >>> sophisticated, dependable use of GOTOs? Since my first days poking around >>> learning C GOTO has been mentally filed away as an assembly vestige for >>> folks in transition, not a dependable construct in its own right. Any >>> alternative camps out there? >>> >> >> >> In C I use it all the time to do goto err for common error recovery >> because C doesn't have anything better. >> >> Warner >> >>> - Matt G. >>> >>> ------- Original Message ------- >>> On Thursday, March 9th, 2023 at 3:01 PM, Steffen Nurpmeso < >>> steffen@sdaoden.eu> wrote: >>> >>> >>> > I wonder if Pink Floyd's Summer68 maybe refers to this. >>> > Other than that i am addicted and could not live without it. >>> > The other (terrible) song is from 1984 (east southern US). >>> > >>> > --steffen >>> > | >>> > |Der Kragenbaer, The moon bear, >>> > |der holt sich munter he cheerfully and one by one >>> > |einen nach dem anderen runter wa.ks himself off >>> > |(By Robert Gernhardt) >>> >> >> > --00000000000025130305f6816889 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Thu, Mar 9, 2023, 5:55 PM segaloco <segaloco@protonmail.com> wrote:
I guess I hadn't considered dee= ply nested loops. I contort myself into a mental pretzel figuring out how t= o avoid GOTOs sometimes, maybe I could stand to embrace one every once in a= while myself...

=
Yea. I recall a proposal to add break label; and the labe= l could only be at the end of a loop. The objection was why bloat the compi= ler with another goto... I developed my restricted lack of fear after a sti= nt in Java with its multilevel break...

Warner

<= br>
Now doing some research, more languages support GOTO than I thou= ght, including C#, PHP, even Rust for all its safety orientation appears to= at least muster a GOTO-ish construct. If people keep doing it, it must sti= ll be wanted, needed, and useful. I stand corrected on my never-GOTO attitu= de. Now to slip a GOTO into a work project and see how long it takes to get= chastised :)

- Matt G.
------- Original Message -------
On Thursday, March 9th, 2023 at 3:54 PM, Warner Losh <imp@bsdimp.com= > wrote:

Oh also sometimes for breaking out of multipl= e levels of while/for loops. The alternatives are often worse.

Warner

On Thu, Mar 9, 2023, 4:31 PM L= uther Johnson <luther@makerlisp.com&g= t; wrote:

I agree, unless I use setjmp/longjmp for that. Besides error recovery, there are occasionally other times when we want to locally "return" to a common state and start "from the= top" again. I find such uses very clear in their intent, and if commented well, not hard to follow at all - as long as there is not more than one "top" :)

On 03/09/2023 04:21 PM, Warner Losh wrote:


On Thu, Mar 9, 2023, 4:18 PM segaloco via TUHS <tuhs@tuhs.or= g> wrote:
GOTO is one of those paradoxical things where I would only trust the most sophisticated engineer to know when it's acceptable to use a GOTO but on the flip side would be suspicious of anyone claiming to be an engineer that uses any amount of GOTOs...

Were any of the various GOTOs in languages ever meant to be any more than providing the same level of control that branch statements in assembly do? Was there ever some vision anyone's aware of concerning a sophisticated, dependable use of GOTOs? Since my first days poking around learning C GOTO has been mentally filed away as an assembly vestige for folks in transition, not a dependable construct in its own right. Any alternative camps out there?


In C I use it all the time to do goto err for common error recovery because C doesn't have anything better.=

Warner
- Matt G.

------- Original Message -------
On Thursday, March 9th, 2023 at 3:01 PM, Steffen Nurpmeso <steffen@sdaoden.eu>= wrote:


> I wonder if Pink Floyd's Summer68 maybe refers to this.
> Other than that i am addicted and could not live without it.
> The other (terrible) song is from 1984 (east southern US).
>
> --steffen
> |
> |Der Kragenbaer, The moon bear,
> |der holt sich munter he cheerfully and one by one
> |einen nach dem anderen runter wa.ks himself off
> |(By Robert Gernhardt)


--00000000000025130305f6816889--