🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: alt.comp.lang.rust
514 messages
514 total messages Page 2 of 11 Started by Lynn McGuire Wed, 14 Oct 2026 04:18
Page 2 of 11 • 514 total messages
Re: Re: “The end of software secrecy is almost upon us"
#55
Author: Scott Dorsey
Date: Mon, 19 Oct 2026 23:01
16 lines
1520 bytes
Blaine  <cactus_DAC@yahoo.com> wrote:
>I guess I take umbrage at your goto statement. I do nothing of the like.

It gets worse than that.

> groovy::                      ; do that groovy thing
> 	.call_entry	max_args=33,home_args=true,preserve=<r3,r5>
> 	movl	(ap),r3       ; boogity boogity boogity
> 	moval	4(ap),r5      ; yeah, you got it baby
> 	ret                   ; go back and do it again
> 	.psect	idata,wrt,noexe,quad
> 	.align	quad
 
--scott
-- 
"C'est un Nagra. C'est suisse, et tres, tres precis."
Re: “The end of software secrecy is almost upon us"
#56
Author: Thomas Koenig
Date: Tue, 20 Oct 2026 05:28
15 lines
2143 bytes
Scott Dorsey <kludge@panix.com> schrieb:
> Lynn McGuire  <lynnmcguire5@gmail.com> wrote:
>>One of the things that I am enjoying is that F2C gets rid of about 75% 
>>of the Fortran Gotos.  The remaining 25% Gotos usually make some sense. 
>>Ok, a little sense that any C or C++ programmer would have never used a 
>>goto there.
>
> It drives me up the wall when people use a goto to jump out of a do loop.
> The compiler is doing so much cleanup work that the programmer never sees.

Again, care to give an example?
-- 
This USENET posting was made without artificial intelligence,
artificial impertinence, artificial arrogance, artificial stupidity,
artificial flavorings or artificial colorants.
Re: “The end of software secrecy is almost upon us"
#57
Author: Titus G
Date: Tue, 20 Oct 2026 05:46
16 lines
2409 bytes
On 20/10/2026 18:28, Thomas Koenig wrote:
> Scott Dorsey <kludge@panix.com> schrieb:
>> Lynn McGuire  <lynnmcguire5@gmail.com> wrote:
>>> One of the things that I am enjoying is that F2C gets rid of about 75% 
>>> of the Fortran Gotos.  The remaining 25% Gotos usually make some sense. 
>>> Ok, a little sense that any C or C++ programmer would have never used a 
>>> goto there.
>>
>> It drives me up the wall when people use a goto to jump out of a do loop.
>> The compiler is doing so much cleanup work that the programmer never sees.
> 
> Again, care to give an example?

I thought that what was called Structured Programming became an
inviolable law when invented by whom I do not know but suspect that
bugger for the bottle or even earlier.
Re: “The end of software secrecy is almost upon us"
#58
Author: Lynn McGuire
Date: Tue, 20 Oct 2026 05:48
16 lines
2275 bytes
On 10/19/2026 5:57 PM, Scott Dorsey wrote:
> Lynn McGuire  <lynnmcguire5@gmail.com> wrote:
>> One of the things that I am enjoying is that F2C gets rid of about 75%
>> of the Fortran Gotos.  The remaining 25% Gotos usually make some sense.
>> Ok, a little sense that any C or C++ programmer would have never used a
>> goto there.
> 
> It drives me up the wall when people use a goto to jump out of a do loop.
> The compiler is doing so much cleanup work that the programmer never sees.
> --scott

Why do you care about unseen work that the compiler is doing?  I 
guarantee that most programmers in these 64 bit days do not care.

Lynn
Re: Re: “The end of software secrecy is almost upon us"
#60
Author: Scott Dorsey
Date: Tue, 20 Oct 2026 13:39
19 lines
1854 bytes
Lynn McGuire  <lynnmcguire5@gmail.com> wrote:
>On 10/19/2026 5:57 PM, Scott Dorsey wrote:
>> Lynn McGuire  <lynnmcguire5@gmail.com> wrote:
>>> One of the things that I am enjoying is that F2C gets rid of about 75%
>>> of the Fortran Gotos.  The remaining 25% Gotos usually make some sense.
>>> Ok, a little sense that any C or C++ programmer would have never used a
>>> goto there.
>> 
>> It drives me up the wall when people use a goto to jump out of a do loop.
>> The compiler is doing so much cleanup work that the programmer never sees.
>
>Why do you care about unseen work that the compiler is doing?  I 
>guarantee that most programmers in these 64 bit days do not care.

Because I want my code to run fast!  I do very much seem to be in the 
minority today, it is true.
--scott
-- 
"C'est un Nagra. C'est suisse, et tres, tres precis."
Re: “The end of software secrecy is almost upon us"
#59
Author: Johann 'Myrkraverk' Oskarsson
Date: Tue, 20 Oct 2026 13:51
37 lines
3167 bytes
On 10/20/2026 9:39 PM, Scott Dorsey wrote:
> Lynn McGuire  <lynnmcguire5@gmail.com> wrote:
>> On 10/19/2026 5:57 PM, Scott Dorsey wrote:
>>> Lynn McGuire  <lynnmcguire5@gmail.com> wrote:
>>>> One of the things that I am enjoying is that F2C gets rid of about 75%
>>>> of the Fortran Gotos.  The remaining 25% Gotos usually make some sense.
>>>> Ok, a little sense that any C or C++ programmer would have never used a
>>>> goto there.
>>>
>>> It drives me up the wall when people use a goto to jump out of a do loop.
>>> The compiler is doing so much cleanup work that the programmer never sees.
>>
>> Why do you care about unseen work that the compiler is doing?  I
>> guarantee that most programmers in these 64 bit days do not care.
> 
> Because I want my code to run fast!  I do very much seem to be in the
> minority today, it is true.
> --scott

I presume you're working on some /hot code/, and will comment according-
ly.

I've come across complaints -- that I don't have handy -- that compilers
sometimes under-optimize, or otherwise cannot be told to do the right
thing.  One memorable complaint was the inability of then-GCC to align
a specific loop to the cache -- I believe a 16 byte boundary -- it was
only everything -- with the resulting drop in performance everywhere
else -- or nothing because there was no #pragma nor [[attribute]] to say
/this loop needs to be cache aligned/.


What do you do in these circumstances?  Has this happened to you at all?
-- 
Johann | email: invalid -> com | http://www.myrkraverk.com/blog/
I'm not from the Internet, I just work there. | via Easynews.com
https://bsky.app/profile/myrkraverk.bsky.social | for ( ;; ) _:;
Federated at https://fed.brid.gy/bsky/myrkraverk.bsky.social
Re: “The end of software secrecy is almost upon us"
#61
Author: Thomas Koenig
Date: Tue, 20 Oct 2026 15:50
14 lines
2280 bytes
Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> schrieb:

> I've come across complaints -- that I don't have handy -- that compilers
> sometimes under-optimize, or otherwise cannot be told to do the right
> thing.

https://gcc.gnu.org/bugzilla/buglist.cgi?bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=SUSPENDED&bug_status=WAITING&bug_status=REOPENED&cf_known_to_fail_type=allwords&cf_known_to_work_type=allwords&keywords=missed-optimization%2C%20&keywords_type=allwords&limit=0&list_id=536399&order=priority%2Cbug_severity&query_format=advanced

gives you (as of now) 4588 exammples.

-- 
This USENET posting was made without artificial intelligence,
artificial impertinence, artificial arrogance, artificial stupidity,
artificial flavorings or artificial colorants.
Re: “The end of software secrecy is almost upon us"
#64
Author: Thomas Koenig
Date: Tue, 20 Oct 2026 17:15
48 lines
3656 bytes
Lynn McGuire <lynnmcguire5@gmail.com> schrieb:
> On 10/19/2026 5:57 PM, Scott Dorsey wrote:
>> Lynn McGuire  <lynnmcguire5@gmail.com> wrote:
>>> One of the things that I am enjoying is that F2C gets rid of about 75%
>>> of the Fortran Gotos.  The remaining 25% Gotos usually make some sense.
>>> Ok, a little sense that any C or C++ programmer would have never used a
>>> goto there.
>> 
>> It drives me up the wall when people use a goto to jump out of a do loop.
>> The compiler is doing so much cleanup work that the programmer never sees.

I'd really like to know what that cleanup work is supposed to be (as
somebody who is involved with Fortran compiler development).

I am beginning to suspect that Scott is the only person in the
world who sees this supposed inefficiency.

>> --scott
>
> Why do you care about unseen work that the compiler is doing?  I 
> guarantee that most programmers in these 64 bit days do not care.

For very many problems, there is no need to be efficient - it very
certainly does not matter if a program that is executed once takes
0.01 s or 0.1s.

But the attitude of not caring about speed can have grave results
when the inefficiencies pile up.  People who use Python for
everything may find that instead of 0.1 s, their code suddenly
runs for hours, when it would need seconds in a compiled language.

Or look at the pile of resource-wasting junk like Microsoft
Teams runnig on top of the pile of resource-wasting junk called
Microsoft Windows.  Teams grabs a humungous amount of memory so 16
GB is borderline unusable in a commercial enviroment.  Makes the
recent memory price hike all the more interesting...

Don't know about your code, but I remember waiting a long time
for Aspen simulations... but then again, those diverge from
a converged solution, which shows that if Aspen has the first
clue about numerical methods, they are very good at hiding it.

I just hope your software is better, at least in that respect.

-- 
This USENET posting was made without artificial intelligence,
artificial impertinence, artificial arrogance, artificial stupidity,
artificial flavorings or artificial colorants.
Re: “The end of software secrecy is almost upon us"
#62
Author: Cryptoengineer
Date: Tue, 20 Oct 2026 17:20
25 lines
2641 bytes
On 10/20/2026 1:46 AM, Titus G wrote:
> On 20/10/2026 18:28, Thomas Koenig wrote:
>> Scott Dorsey <kludge@panix.com> schrieb:
>>> Lynn McGuire  <lynnmcguire5@gmail.com> wrote:
>>>> One of the things that I am enjoying is that F2C gets rid of about 75%
>>>> of the Fortran Gotos.  The remaining 25% Gotos usually make some sense.
>>>> Ok, a little sense that any C or C++ programmer would have never used a
>>>> goto there.
>>>
>>> It drives me up the wall when people use a goto to jump out of a do loop.
>>> The compiler is doing so much cleanup work that the programmer never sees.
>>
>> Again, care to give an example?
> 
> I thought that what was called Structured Programming became an
> inviolable law when invented by whom I do not know but suspect that
> bugger for the bottle or even earlier.

ITYM:

Edgar Dijkstra: Go To Statement Considered Harmful

https://homepages.cwi.nl/~storm/teaching/reader/Dijkstra68.pdf

pt
Re: “The end of software secrecy is almost upon
#63
Author: boltar
Date: Tue, 20 Oct 2026 17:24
25 lines
2739 bytes
On Tue, 20 Oct 2026 17:15:28 -0000 (UTC)
Thomas Koenig <tkoenig@netcologne.de> wrote:
>Lynn McGuire <lynnmcguire5@gmail.com> schrieb:
>> On 10/19/2026 5:57 PM, Scott Dorsey wrote:
>>> Lynn McGuire  <lynnmcguire5@gmail.com> wrote:
>>>> One of the things that I am enjoying is that F2C gets rid of about 75%
>>>> of the Fortran Gotos.  The remaining 25% Gotos usually make some sense.
>>>> Ok, a little sense that any C or C++ programmer would have never used a
>>>> goto there.
>>> 
>>> It drives me up the wall when people use a goto to jump out of a do loop.
>>> The compiler is doing so much cleanup work that the programmer never sees.
>
>I'd really like to know what that cleanup work is supposed to be (as
>somebody who is involved with Fortran compiler development).

If C/C++ had multi level break and continue keywords goto would almost
never be needed**. There's no reason they can't be added - along with a lot of
other useful but basic fatures (eg non POD switch, native concatting numbers to 
std::string without calling to_string) - but I guess the committee are too busy
circle jerking with esoteric crap no one will ever use (eg concepts) to bother.

** The setting a flag method which has to be checked in every nested loop test 
   is just an assinine way to code.
Re: Re: “The end of software secrecy is almost upon
#65
Author: boltar
Date: Tue, 20 Oct 2026 18:14
26 lines
2565 bytes
On Tue, 20 Oct 2026 13:20:40 -0400
Cryptoengineer <petertrei@gmail.com> wrote:
>On 10/20/2026 1:46 AM, Titus G wrote:
>> On 20/10/2026 18:28, Thomas Koenig wrote:
>>> Scott Dorsey <kludge@panix.com> schrieb:
>>>> Lynn McGuire  <lynnmcguire5@gmail.com> wrote:
>>>>> One of the things that I am enjoying is that F2C gets rid of about 75%
>>>>> of the Fortran Gotos.  The remaining 25% Gotos usually make some sense.
>>>>> Ok, a little sense that any C or C++ programmer would have never used a
>>>>> goto there.
>>>>
>>>> It drives me up the wall when people use a goto to jump out of a do loop.
>>>> The compiler is doing so much cleanup work that the programmer never sees.
>>>
>>> Again, care to give an example?
>> 
>> I thought that what was called Structured Programming became an
>> inviolable law when invented by whom I do not know but suspect that
>> bugger for the bottle or even earlier.
>
>ITYM:
>
>Edgar Dijkstra: Go To Statement Considered Harmful

A man who clearly never programmed in assembler.
Re: Re: “The end of software secrecy is almost upon
#66
Author: Scott Dorsey
Date: Tue, 20 Oct 2026 18:22
14 lines
1511 bytes
In article <11b8b2k$p44i$1@dont-email.me>,  <boltar@battlestar.co.uk> wrote:
>Cryptoengineer <petertrei@gmail.com> wrote:
>>Edgar Dijkstra: Go To Statement Considered Harmful
>
>A man who clearly never programmed in assembler.

I have seen a structured assembler class and it's actually not a bad way
to think at all.  Having LOOPZ and REP* and similar instructions make it 
easier to think about do loops.

The key to writing structured assembly is commenting.
--scott
-- 
"C'est un Nagra. C'est suisse, et tres, tres precis."
Re: Re: “The end of software secrecy is almost upon
#67
Author: boltar
Date: Tue, 20 Oct 2026 18:29
16 lines
2037 bytes
On Tue, 20 Oct 2026 14:22:02 -0400 (EDT)
kludge@panix.com (Scott Dorsey) wrote:
>In article <11b8b2k$p44i$1@dont-email.me>,  <boltar@battlestar.co.uk> wrote:
>>Cryptoengineer <petertrei@gmail.com> wrote:
>>>Edgar Dijkstra: Go To Statement Considered Harmful
>>
>>A man who clearly never programmed in assembler.
>
>I have seen a structured assembler class and it's actually not a bad way
>to think at all.  Having LOOPZ and REP* and similar instructions make it 
>easier to think about do loops.

Great if the cpu supports those sorts of instructions. Most however rely
on some version of jump-on-flag-set/not-set for flow of control apart from
call-ret.
Re: “The end of software secrecy is almost upon us"
#68
Author: William Hyde
Date: Tue, 20 Oct 2026 18:36
44 lines
3287 bytes
Cryptoengineer wrote:
> On 10/20/2026 1:46 AM, Titus G wrote:
>> On 20/10/2026 18:28, Thomas Koenig wrote:
>>> Scott Dorsey <kludge@panix.com> schrieb:
>>>> Lynn McGuire  <lynnmcguire5@gmail.com> wrote:
>>>>> One of the things that I am enjoying is that F2C gets rid of about 75%
>>>>> of the Fortran Gotos.  The remaining 25% Gotos usually make some 
>>>>> sense.
>>>>> Ok, a little sense that any C or C++ programmer would have never 
>>>>> used a
>>>>> goto there.
>>>>
>>>> It drives me up the wall when people use a goto to jump out of a do 
>>>> loop.
>>>> The compiler is doing so much cleanup work that the programmer never 
>>>> sees.
>>>
>>> Again, care to give an example?
>>
>> I thought that what was called Structured Programming became an
>> inviolable law when invented by whom I do not know but suspect that
>> bugger for the bottle or even earlier.
> 
> ITYM:
> 
> Edgar Dijkstra: Go To Statement Considered Harmful
> 
> https://homepages.cwi.nl/~storm/teaching/reader/Dijkstra68.pdf
>
First year computer science prof:

"When I first learned to program I thanked god for the goto statement. 
Now I hate the very sight of it".

Luckily I took German instead.

My own code was liberally festooned with goto statments, but as far as I 
can recall I never put a pointer in common.

Using goto to exit loops?  I can't recall doing that.  But I can't rule 
it out.

William Hyde
Re: “The end of software secrecy is almost upon us"
#69
Author: William Hyde
Date: Tue, 20 Oct 2026 18:48
42 lines
3528 bytes
Scott Dorsey wrote:
> Lynn McGuire  <lynnmcguire5@gmail.com> wrote:
>> On 10/19/2026 5:57 PM, Scott Dorsey wrote:
>>> Lynn McGuire  <lynnmcguire5@gmail.com> wrote:
>>>> One of the things that I am enjoying is that F2C gets rid of about 75%
>>>> of the Fortran Gotos.  The remaining 25% Gotos usually make some sense.
>>>> Ok, a little sense that any C or C++ programmer would have never used a
>>>> goto there.
>>>
>>> It drives me up the wall when people use a goto to jump out of a do loop.
>>> The compiler is doing so much cleanup work that the programmer never sees.
>>
>> Why do you care about unseen work that the compiler is doing?  I
>> guarantee that most programmers in these 64 bit days do not care.
> 
> Because I want my code to run fast!  I do very much seem to be in the
> minority today, it is true.

We simply didn't have the computer resources to run my PhD code 
normally.  I spoke to more experienced programmers and learned many 
tricks to speed things up.  This probably knocked a year off my PhD, to 
the great benefit of my sanity and financial health.

And in climate modelling, these tricks proved useful again and again.  A 
month spent optimizing code could save a year on a big project. We were 
always pushing the limits of whatever our computers could do.


The first general circulation model I worked with was a spectral model 
using spherical harmonics out to order twenty or so.  The last went to 
order 178.  Give us a faster computer and we'll bog it down immediately.

Mind you the movie of the T178 storm tracks in the last ice age was a 
wonder to behold.

As a coder I was at best 3/10 in scientific code.  At accelerating 
scientific code, maybe 5.

At game development, 0.01.

William Hyde
Re: “The end of software secrecy is almost upon
#70
Author: David Brown
Date: Tue, 20 Oct 2026 18:50
35 lines
3418 bytes
On 20/10/2026 19:24, boltar@battlestar.co.uk wrote:
> On Tue, 20 Oct 2026 17:15:28 -0000 (UTC)
> Thomas Koenig <tkoenig@netcologne.de> wrote:
>> Lynn McGuire <lynnmcguire5@gmail.com> schrieb:
>>> On 10/19/2026 5:57 PM, Scott Dorsey wrote:
>>>> Lynn McGuire  <lynnmcguire5@gmail.com> wrote:
>>>>> One of the things that I am enjoying is that F2C gets rid of about 75%
>>>>> of the Fortran Gotos.  The remaining 25% Gotos usually make some sense.
>>>>> Ok, a little sense that any C or C++ programmer would have never used a
>>>>> goto there.
>>>>
>>>> It drives me up the wall when people use a goto to jump out of a do loop.
>>>> The compiler is doing so much cleanup work that the programmer never sees.
>>
>> I'd really like to know what that cleanup work is supposed to be (as
>> somebody who is involved with Fortran compiler development).
> 
> If C/C++ had multi level break and continue keywords goto would almost
> never be needed**. There's no reason they can't be added - along with a lot of
> other useful but basic fatures (eg non POD switch, native concatting numbers to
> std::string without calling to_string) - but I guess the committee are too busy
> circle jerking with esoteric crap no one will ever use (eg concepts) to bother.
> 

Multi-level break and continue (named loops) is on its way to C++, and 
will almost certainly be accepted sooner or later (since it is already 
in the draft of the next C standard):

<https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3568r0.html>

And people /do/ use concepts, even if you do not.

You might want to do some research before insulting the people who are 
actually doing the work in driving languages forward.
Re: “The end of software secrecy is almost upon
#72
Author: Charlie Gibbs
Date: Tue, 20 Oct 2026 19:04
41 lines
2887 bytes
On 2026-10-20, boltar@battlestar.co.uk <boltar@battlestar.co.uk> wrote:

> On Tue, 20 Oct 2026 13:20:40 -0400
>
> Cryptoengineer <petertrei@gmail.com> wrote:
>
>> On 10/20/2026 1:46 AM, Titus G wrote:
>>
>>> I thought that what was called Structured Programming became an
>>> inviolable law when invented by whom I do not know but suspect that
>>> bugger for the bottle or even earlier.
>>
>> ITYM:
>>
>> Edgar Dijkstra: Go To Statement Considered Harmful
>
> A man who clearly never programmed in assembler.

Of course.  He was a CS weenie - any mention of low-level
programming makes those types turn purple.

Although Structured Programming introduced some good concepts,
it also built a following of fanatics more bent on crucifying
infidels than writing good practical programs.  Some people
came to see the number of function calls a program made as
a figure of merit, resulting in dozens of tiny functions that
caused control to jump all over the place (which made virtual
memory systems thrash).  And the end result wasn't that much
more readable.

The undisciplined use of GOTOs is bad, agreed.  But the
undisciplined use of function calls isn't a whole lot better.
After all, a function call is just a GOTO paired with a
"come from", so in the end it's all still spaghetti code -
it's just that the "structured" code runs double strands.

-- 
/~\  Charlie Gibbs                  |  In this world there are
\ /  <cgibbs@kltpzyxm.invalid>      |  two kinds of people:
 X   I'm really at ac.dekanfrus     |  1. Those who can extrapolate
/ \  if you read it the right way.  |  from incomplete data.
Re: “The end of software secrecy is almost upon us"
#71
Author: Peter Flass
Date: Tue, 20 Oct 2026 19:10
48 lines
3907 bytes
On 10/20/26 10:15, Thomas Koenig wrote:
> Lynn McGuire <lynnmcguire5@gmail.com> schrieb:
>> On 10/19/2026 5:57 PM, Scott Dorsey wrote:
>>> Lynn McGuire  <lynnmcguire5@gmail.com> wrote:
>>>> One of the things that I am enjoying is that F2C gets rid of about 75%
>>>> of the Fortran Gotos.  The remaining 25% Gotos usually make some sense.
>>>> Ok, a little sense that any C or C++ programmer would have never used a
>>>> goto there.
>>>
>>> It drives me up the wall when people use a goto to jump out of a do loop.
>>> The compiler is doing so much cleanup work that the programmer never sees.
> 
> I'd really like to know what that cleanup work is supposed to be (as
> somebody who is involved with Fortran compiler development).
> 
> I am beginning to suspect that Scott is the only person in the
> world who sees this supposed inefficiency.
> 
>>> --scott
>>
>> Why do you care about unseen work that the compiler is doing?  I
>> guarantee that most programmers in these 64 bit days do not care.
> 
> For very many problems, there is no need to be efficient - it very
> certainly does not matter if a program that is executed once takes
> 0.01 s or 0.1s.
> 
> But the attitude of not caring about speed can have grave results
> when the inefficiencies pile up.  People who use Python for
> everything may find that instead of 0.1 s, their code suddenly
> runs for hours, when it would need seconds in a compiled language.
> 
> Or look at the pile of resource-wasting junk like Microsoft
> Teams runnig on top of the pile of resource-wasting junk called
> Microsoft Windows.  Teams grabs a humungous amount of memory so 16
> GB is borderline unusable in a commercial enviroment.  Makes the
> recent memory price hike all the more interesting...
> 
> Don't know about your code, but I remember waiting a long time
> for Aspen simulations... but then again, those diverge from
> a converged solution, which shows that if Aspen has the first
> clue about numerical methods, they are very good at hiding it.
> 
> I just hope your software is better, at least in that respect.
> 

If there is any work to do, the compiler should also be able to do it in 
the case of a GOTO out of a loop.
Re: “The end of software secrecy is almost upon
#73
Author: Peter Flass
Date: Tue, 20 Oct 2026 19:11
27 lines
3120 bytes
On 10/20/26 10:24, boltar@battlestar.co.uk wrote:
> On Tue, 20 Oct 2026 17:15:28 -0000 (UTC)
> Thomas Koenig <tkoenig@netcologne.de> wrote:
>> Lynn McGuire <lynnmcguire5@gmail.com> schrieb:
>>> On 10/19/2026 5:57 PM, Scott Dorsey wrote:
>>>> Lynn McGuire  <lynnmcguire5@gmail.com> wrote:
>>>>> One of the things that I am enjoying is that F2C gets rid of about 75%
>>>>> of the Fortran Gotos.  The remaining 25% Gotos usually make some sense.
>>>>> Ok, a little sense that any C or C++ programmer would have never used a
>>>>> goto there.
>>>>
>>>> It drives me up the wall when people use a goto to jump out of a do loop.
>>>> The compiler is doing so much cleanup work that the programmer never sees.
>>
>> I'd really like to know what that cleanup work is supposed to be (as
>> somebody who is involved with Fortran compiler development).
> 
> If C/C++ had multi level break and continue keywords goto would almost
> never be needed**. There's no reason they can't be added - along with a lot of
> other useful but basic fatures (eg non POD switch, native concatting numbers to
> std::string without calling to_string) - but I guess the committee are too busy
> circle jerking with esoteric crap no one will ever use (eg concepts) to bother.
> 
> ** The setting a flag method which has to be checked in every nested loop test
>     is just an assinine way to code.

They just keep trying to re-invert PL/I.
Re: “The end of software secrecy is almost upon
#74
Author: Thomas Koenig
Date: Tue, 20 Oct 2026 19:54
34 lines
2750 bytes
Charlie Gibbs <cgibbs@kltpzyxm.invalid> schrieb:
> On 2026-10-20, boltar@battlestar.co.uk <boltar@battlestar.co.uk> wrote:
>
>> On Tue, 20 Oct 2026 13:20:40 -0400
>>
>> Cryptoengineer <petertrei@gmail.com> wrote:
>>
>>> On 10/20/2026 1:46 AM, Titus G wrote:
>>>
>>>> I thought that what was called Structured Programming became an
>>>> inviolable law when invented by whom I do not know but suspect that
>>>> bugger for the bottle or even earlier.
>>>
>>> ITYM:
>>>
>>> Edgar Dijkstra: Go To Statement Considered Harmful
>>
>> A man who clearly never programmed in assembler.
>
> Of course.  He was a CS weenie - any mention of low-level
> programming makes those types turn purple.

Nonsense.

Dijstra started programming in 1951, they didn't even have
assemblers on the machines, it was pretty much naked machine code.

Whatever else his faults may have been (arrogance certainly being
among them), he was no stranger to low-level programming.

-- 
This USENET posting was made without artificial intelligence,
artificial impertinence, artificial arrogance, artificial stupidity,
artificial flavorings or artificial colorants.
Re: “The end of software secrecy is almost upon
#75
Author: Lawrence D’Oliveiro
Date: Tue, 20 Oct 2026 20:00
18 lines
2432 bytes
On Tue, 20 Oct 2026 19:04:55 GMT, Charlie Gibbs wrote:

> The undisciplined use of GOTOs is bad, agreed.

Is there such a thing as a *disciplined* use of gotos?

I find the C code I write tends to do a lot of dynamic resource
allocations. These can sometimes fail with errors. So error recovery
will invariably involve cleaning up those parts of the allocations
which already succeeded. Gotos are no good for this; you need to exit
levels of structure nesting one by one, disposing of allocations as
you go.

I put together an example here
<https://gitlab.com/ldo/a_structured_discipline_of_programming>. This
is an extension module that offers services to Python code, because
that is just about the worst example I could think of, for those who
think gotos can cut it.
Re: “The end of software secrecy is almost upon
#76
Author: Lynn McGuire
Date: Tue, 20 Oct 2026 20:06
24 lines
2578 bytes
On 10/20/2026 1:22 PM, Scott Dorsey wrote:
> In article <11b8b2k$p44i$1@dont-email.me>,  <boltar@battlestar.co.uk> wrote:
>> Cryptoengineer <petertrei@gmail.com> wrote:
>>> Edgar Dijkstra: Go To Statement Considered Harmful
>>
>> A man who clearly never programmed in assembler.
> 
> I have seen a structured assembler class and it's actually not a bad way
> to think at all.  Having LOOPZ and REP* and similar instructions make it
> easier to think about do loops.
> 
> The key to writing structured assembly is commenting.
> --scott

The key to writing any software is lots of commenting.

About a third of my calculation engine was written pre 1978 (250,000 
lines of Fortran 66 code) and that code cost us money to sit on a drum 
drive on a Univac 1108.  So no comments for that code except where 
somebody came along and threw something in there after 1977.  Sometimes 
the later comments are correct, sometimes the later comments are wrong.

Lynn
Re: “The end of software secrecy is almost upon us"
#78
Author: Lynn McGuire
Date: Tue, 20 Oct 2026 20:20
64 lines
4686 bytes
On 10/20/2026 12:15 PM, Thomas Koenig wrote:
> Lynn McGuire <lynnmcguire5@gmail.com> schrieb:
>> On 10/19/2026 5:57 PM, Scott Dorsey wrote:
>>> Lynn McGuire  <lynnmcguire5@gmail.com> wrote:
>>>> One of the things that I am enjoying is that F2C gets rid of about 75%
>>>> of the Fortran Gotos.  The remaining 25% Gotos usually make some sense.
>>>> Ok, a little sense that any C or C++ programmer would have never used a
>>>> goto there.
>>>
>>> It drives me up the wall when people use a goto to jump out of a do loop.
>>> The compiler is doing so much cleanup work that the programmer never sees.
> 
> I'd really like to know what that cleanup work is supposed to be (as
> somebody who is involved with Fortran compiler development).
> 
> I am beginning to suspect that Scott is the only person in the
> world who sees this supposed inefficiency.
> 
>>> --scott
>>
>> Why do you care about unseen work that the compiler is doing?  I
>> guarantee that most programmers in these 64 bit days do not care.
> 
> For very many problems, there is no need to be efficient - it very
> certainly does not matter if a program that is executed once takes
> 0.01 s or 0.1s.
> 
> But the attitude of not caring about speed can have grave results
> when the inefficiencies pile up.  People who use Python for
> everything may find that instead of 0.1 s, their code suddenly
> runs for hours, when it would need seconds in a compiled language.
> 
> Or look at the pile of resource-wasting junk like Microsoft
> Teams runnig on top of the pile of resource-wasting junk called
> Microsoft Windows.  Teams grabs a humungous amount of memory so 16
> GB is borderline unusable in a commercial enviroment.  Makes the
> recent memory price hike all the more interesting...
> 
> Don't know about your code, but I remember waiting a long time
> for Aspen simulations... but then again, those diverge from
> a converged solution, which shows that if Aspen has the first
> clue about numerical methods, they are very good at hiding it.
> 
> I just hope your software is better, at least in that respect.

Most of our convergence methods use Newton-Raphson, yes that Isaac 
Newton, to start, very quick to solve if it solves.  If that spirals out 
of control then we use the halving method, brute force and very slow. 
If that fails then we use an interpolation method, also very slow.  If 
that fails (the flash is infeasible), then we report the failure to the 
user.

Our rigorous four phase flash is the worst since it solves two sets of 
k-values simultaneously with a vapor-liquid-solid fugacity based solid 
flash.  The four phases are vapor, hydrocarbon liquid, aqueous liquid, 
and solid.  Almost 300,000 lines of Fortran 66/77 code that I am 
converting to C++.

And there are exceptions all over the place to the above since our 
software is Frankenstein consisting of the Design, Distill, Refine, and 
Gasplant Plus programs merged together.

Lynn
Re: “The end of software secrecy is almost upon
#77
Author: Lawrence D’Oliveiro
Date: Tue, 20 Oct 2026 20:20
33 lines
2877 bytes
On Tue, 20 Oct 2026 15:06:48 -0500, Lynn McGuire wrote:

> The key to writing any software is lots of commenting.

A key point about comments is they should explain *why* the code is
doing what it’s doing, not simply repeat *what* it is doing. E.g.

    watcher = inotify.Watcher.create()
    watching = {}
    # Monitor immediate containing directories for possibility of files
    # disappearing, assuming those directories will not themselves disappear!
    FILE_EVENTS = \
        { # watch for the file itself changing or disappearing
            IN_BIT.CLOSE_WRITE,
            IN_BIT.DELETE_SELF,
            IN_BIT.MOVE_SELF,
            IN_BIT.MASK_CREATE, # files mustn’t be the same!
        }
    for key in path_keys :
        path = config[key]
        parent = os.path.dirname(path) # assumes I don’t need to normalize path
        watching[path] = watcher.watch(path, FILE_EVENTS)
        # plus a watch on parent directory for disappeared file coming back:
        # (This won’t work if file was symlinked; do I care?)
        if parent not in watching :
            # files will typically be in same directory
            watching[parent] = watcher.watch \
              (
                parent,
                {IN_BIT.CREATE, IN_BIT.MOVED_TO, IN_BIT.ONLYDIR}
              )
        #end if
    #end for
Re: “The end of software secrecy is almost upon
#79
Author: Cryptoengineer
Date: Tue, 20 Oct 2026 20:40
20 lines
2218 bytes
On 10/20/2026 2:22 PM, Scott Dorsey wrote:
> In article <11b8b2k$p44i$1@dont-email.me>,  <boltar@battlestar.co.uk> wrote:
>> Cryptoengineer <petertrei@gmail.com> wrote:
>>> Edgar Dijkstra: Go To Statement Considered Harmful
>>
>> A man who clearly never programmed in assembler.
> 
> I have seen a structured assembler class and it's actually not a bad way
> to think at all.  Having LOOPZ and REP* and similar instructions make it
> easier to think about do loops.
> 
> The key to writing structured assembly is commenting.

The key to writing [] assembly is commenting.

Fixed That For You.

pt

Re: Re: “The end of software secrecy is almost upon us"
#81
Author: Scott Dorsey
Date: Tue, 20 Oct 2026 20:41
43 lines
2885 bytes
Johann 'Myrkraverk' Oskarsson  <johann@myrkraverk.invalid> wrote:
>On 10/20/2026 9:39 PM, Scott Dorsey wrote:
>> Because I want my code to run fast!  I do very much seem to be in the
>> minority today, it is true.
>
>I presume you're working on some /hot code/, and will comment according-
>ly.

It's not super hot, but it's often pretty dense dsp stuff and requires
extensive commenting to describe exactly what equations are for and how
they are being used.

Unfortunately so much of the code I deal with has comments like

C      BRAINDAMAGE!  ROCKWELL-COLLINS BRAINDAMAGE!

Which are expressive and they are good warnings that something is about
to follow which has to do with hardware design deficiencies but not 
actually very informative about what they are.

>I've come across complaints -- that I don't have handy -- that compilers
>sometimes under-optimize, or otherwise cannot be told to do the right
>thing.  One memorable complaint was the inability of then-GCC to align
>a specific loop to the cache -- I believe a 16 byte boundary -- it was
>only everything -- with the resulting drop in performance everywhere
>else -- or nothing because there was no #pragma nor [[attribute]] to say
>/this loop needs to be cache aligned/.

There used to be a lot of complaints like that around here, but these
days gcc is so much better than it was even a decade ago.  The new 
gfortran is not perfect but it's entirely acceptable and takes advantage
of the good backend developed for gcc.  The older g77 was excruciating.
I'd read the .a files that came out and just want to hit my head on the
desk.

>What do you do in these circumstances?  Has this happened to you at all?

I go home and I have a drink and I try not to think about it.  Yes, it
could run a lot better but....
--scott

-- 
"C'est un Nagra. C'est suisse, et tres, tres precis."
Re: Re: “The end of software secrecy is almost upon
#80
Author: Scott Lurndal
Date: Tue, 20 Oct 2026 20:49
35 lines
2634 bytes
boltar@battlestar.co.uk writes:
>On Tue, 20 Oct 2026 13:20:40 -0400
>Cryptoengineer <petertrei@gmail.com> wrote:
>>On 10/20/2026 1:46 AM, Titus G wrote:
>>> On 20/10/2026 18:28, Thomas Koenig wrote:
>>>> Scott Dorsey <kludge@panix.com> schrieb:
>>>>> Lynn McGuire  <lynnmcguire5@gmail.com> wrote:
>>>>>> One of the things that I am enjoying is that F2C gets rid of about 75%
>>>>>> of the Fortran Gotos.  The remaining 25% Gotos usually make some sense.
>>>>>> Ok, a little sense that any C or C++ programmer would have never used a
>>>>>> goto there.
>>>>>
>>>>> It drives me up the wall when people use a goto to jump out of a do loop.
>>>>> The compiler is doing so much cleanup work that the programmer never sees.
>>>>
>>>> Again, care to give an example?
>>> 
>>> I thought that what was called Structured Programming became an
>>> inviolable law when invented by whom I do not know but suspect that
>>> bugger for the bottle or even earlier.
>>
>>ITYM:
>>
>>Edgar Dijkstra: Go To Statement Considered Harmful
>
>A man who clearly never programmed in assembler.
>

Actually, it's highly likely he did program in assembler.

He was a Burroughs fellow for a decade however, working
on the large systems family which did not have an
assembler - flavors of Algol were the only way to write
systems (e.g. MCP) code.
Re: “The end of software secrecy is almost upon
#82
Author: Cryptoengineer
Date: Tue, 20 Oct 2026 20:49
35 lines
2921 bytes
On 10/20/2026 3:04 PM, Charlie Gibbs wrote:
> On 2026-10-20, boltar@battlestar.co.uk <boltar@battlestar.co.uk> wrote:
> 
>> On Tue, 20 Oct 2026 13:20:40 -0400
>>
>> Cryptoengineer <petertrei@gmail.com> wrote:
>>
>>> On 10/20/2026 1:46 AM, Titus G wrote:
>>>
>>>> I thought that what was called Structured Programming became an
>>>> inviolable law when invented by whom I do not know but suspect that
>>>> bugger for the bottle or even earlier.
>>>
>>> ITYM:
>>>
>>> Edgar Dijkstra: Go To Statement Considered Harmful
>>
>> A man who clearly never programmed in assembler.
> 
> Of course.  He was a CS weenie - any mention of low-level
> programming makes those types turn purple.
> 

There was one time when I wrote 6502 assembler including
self-modifying code. That would have made them turn
ultraviolet.

The 6502 had some indexed load and store instructions, where
the instruction contained a base address, which was indexed
with a register. To deal with a big array (bitmap of the
Apple ][ HIRES screen), I wrote code that modified the base
address in the instruction. Of course, I was careful to
reset it when done.

pt
Re: “The end of software secrecy is almost upon us"
#83
Author: Cryptoengineer
Date: Tue, 20 Oct 2026 21:03
25 lines
2683 bytes
On 10/20/2026 1:48 AM, Lynn McGuire wrote:
> On 10/19/2026 5:57 PM, Scott Dorsey wrote:
>> Lynn McGuire  <lynnmcguire5@gmail.com> wrote:
>>> One of the things that I am enjoying is that F2C gets rid of about 75%
>>> of the Fortran Gotos.  The remaining 25% Gotos usually make some sense.
>>> Ok, a little sense that any C or C++ programmer would have never used a
>>> goto there.
>>
>> It drives me up the wall when people use a goto to jump out of a do loop.
>> The compiler is doing so much cleanup work that the programmer never 
>> sees.
>> --scott
> 
> Why do you care about unseen work that the compiler is doing?  I 
> guarantee that most programmers in these 64 bit days do not care.

One side project I worked on at RSA (managing a crowd sourced
effort to crack symmetric keys to push policy on exportable
key length) used literal years of cpu time. Optimizing the code
was paramount.

At one point, I had the world's fastest implementation of the
DES algorithm, though I was soon beaten.

pt
Re: “The end of software secrecy is almost upon us"
#84
Author: Thomas Koenig
Date: Tue, 20 Oct 2026 21:20
42 lines
3310 bytes
Lynn McGuire <lynnmcguire5@gmail.com> schrieb:
> On 10/20/2026 12:15 PM, Thomas Koenig wrote:

>> Don't know about your code, but I remember waiting a long time
>> for Aspen simulations... but then again, those diverge from
>> a converged solution, which shows that if Aspen has the first
>> clue about numerical methods, they are very good at hiding it.
>> 
>> I just hope your software is better, at least in that respect.
>
> Most of our convergence methods use Newton-Raphson, yes that Isaac 
> Newton, to start, very quick to solve if it solves.  If that spirals out 
> of control then we use the halving method, brute force and very slow. 
> If that fails then we use an interpolation method, also very slow.  If 
> that fails (the flash is infeasible), then we report the failure to the 
> user.

Sounds reasonable, but...

How can bisection fail?  If you have bracketed your roots and
have no singularities it always succeeds.

Hmm... molar fractions less than zero, maybe?

> Our rigorous four phase flash is the worst since it solves two sets of 
> k-values simultaneously with a vapor-liquid-solid fugacity based solid 
> flash.  The four phases are vapor, hydrocarbon liquid, aqueous liquid, 
> and solid.  Almost 300,000 lines of Fortran 66/77 code that I am 
> converting to C++.

For two variables, of course, bisection will not work.

> And there are exceptions all over the place to the above since our 
> software is Frankenstein consisting of the Design, Distill, Refine, and 
> Gasplant Plus programs merged together.

I can imagine...

-- 
This USENET posting was made without artificial intelligence,
artificial impertinence, artificial arrogance, artificial stupidity,
artificial flavorings or artificial colorants.
Re: “The end of software secrecy is almost upon us"
#85
Author: Lynn McGuire
Date: Tue, 20 Oct 2026 21:26
46 lines
3707 bytes
On 10/20/2026 4:20 PM, Thomas Koenig wrote:
> Lynn McGuire <lynnmcguire5@gmail.com> schrieb:
>> On 10/20/2026 12:15 PM, Thomas Koenig wrote:
> 
>>> Don't know about your code, but I remember waiting a long time
>>> for Aspen simulations... but then again, those diverge from
>>> a converged solution, which shows that if Aspen has the first
>>> clue about numerical methods, they are very good at hiding it.
>>>
>>> I just hope your software is better, at least in that respect.
>>
>> Most of our convergence methods use Newton-Raphson, yes that Isaac
>> Newton, to start, very quick to solve if it solves.  If that spirals out
>> of control then we use the halving method, brute force and very slow.
>> If that fails then we use an interpolation method, also very slow.  If
>> that fails (the flash is infeasible), then we report the failure to the
>> user.
> 
> Sounds reasonable, but...
> 
> How can bisection fail?  If you have bracketed your roots and
> have no singularities it always succeeds.
> 
> Hmm... molar fractions less than zero, maybe?
> 
>> Our rigorous four phase flash is the worst since it solves two sets of
>> k-values simultaneously with a vapor-liquid-solid fugacity based solid
>> flash.  The four phases are vapor, hydrocarbon liquid, aqueous liquid,
>> and solid.  Almost 300,000 lines of Fortran 66/77 code that I am
>> converting to C++.
> 
> For two variables, of course, bisection will not work.
> 
>> And there are exceptions all over the place to the above since our
>> software is Frankenstein consisting of the Design, Distill, Refine, and
>> Gasplant Plus programs merged together.
> 
> I can imagine...

An infeasible problem is impossible to solve but it has to go through 
all of the solvers before it is declared to be infeasible.  We have some 
quality analysis (Michelson, et al) but if you do quality analysis, you 
have solved most of the problem already.

Lynn
Re: “The end of software secrecy is almost upon
#86
Author: Charlie Gibbs
Date: Tue, 20 Oct 2026 23:18
37 lines
3060 bytes
On 2026-10-20, Lawrence D’Oliveiro <ldo@nz.invalid> wrote:

> On Tue, 20 Oct 2026 19:04:55 GMT, Charlie Gibbs wrote:
>
>> The undisciplined use of GOTOs is bad, agreed.
>
> Is there such a thing as a *disciplined* use of gotos?

Yes, especially in COBOL or assembly language.  For instance,
a GOTO to the end of a function ensures any of its cleanup code
gets executed, and fulfils a goal of structured proramming:
each function has one exit point.

> I find the C code I write tends to do a lot of dynamic resource
> allocations. These can sometimes fail with errors. So error recovery
> will invariably involve cleaning up those parts of the allocations
> which already succeeded. Gotos are no good for this; you need to exit
> levels of structure nesting one by one, disposing of allocations as
> you go.

I know that a lot of CS types are going to stick pins into little
dolls that look like me for saying this, but IMHO resource pointers,
handles, etc. should be global.  Possible exceptions are resources
that are going to be used solely by the current function - but even
then, if that function calls another function that fails horribly,
there's stuff that might not get cleaned up.  That's why all my
C programs contain a function quit_cleanup(char *errmsg), which
de-allocates all resources and then exits (displaying "errmsg"
if it isn't NULL).  I can call that function anywhere, safe in
the knowledge that by the time it finishes (it never returns),
everything will have be freed.

-- 
/~\  Charlie Gibbs                  |  In this world there are
\ /  <cgibbs@kltpzyxm.invalid>      |  two kinds of people:
 X   I'm really at ac.dekanfrus     |  1. Those who can extrapolate
/ \  if you read it the right way.  |  from incomplete data.
Re: “The end of software secrecy is almost upon
#87
Author: Steven G. Kargl
Date: Tue, 20 Oct 2026 23:20
15 lines
2108 bytes
On Tue, 20 Oct 2026 20:00:03 -0000 (UTC), Lawrence D’Oliveiro wrote:

> On Tue, 20 Oct 2026 19:04:55 GMT, Charlie Gibbs wrote:
> 
>> The undisciplined use of GOTOs is bad, agreed.
> 
> Is there such a thing as a *disciplined* use of gotos?
> 

Yes.  D. Knuth, Structured Programming with go to Statements,
ACM Computing Surveys (CSUR), Vol 6, Issue 4, Pp 261-301, 1974
https://doi.org/10.1145/356635.356640

-- 
steve
Re: “The end of software secrecy is almost upon
#88
Author: William Hyde
Date: Tue, 20 Oct 2026 23:32
31 lines
2954 bytes
Lynn McGuire wrote:
> On 10/20/2026 1:22 PM, Scott Dorsey wrote:
>> In article <11b8b2k$p44i$1@dont-email.me>,  <boltar@battlestar.co.uk> 
>> wrote:
>>> Cryptoengineer <petertrei@gmail.com> wrote:
>>>> Edgar Dijkstra: Go To Statement Considered Harmful
>>>
>>> A man who clearly never programmed in assembler.
>>
>> I have seen a structured assembler class and it's actually not a bad way
>> to think at all.  Having LOOPZ and REP* and similar instructions make it
>> easier to think about do loops.
>>
>> The key to writing structured assembly is commenting.
>> --scott
> 
> The key to writing any software is lots of commenting.
> 
> About a third of my calculation engine was written pre 1978 (250,000 
> lines of Fortran 66 code) and that code cost us money to sit on a drum 
> drive on a Univac 1108.  So no comments for that code except where 
> somebody came along and threw something in there after 1977.  Sometimes 
> the later comments are correct, sometimes the later comments are wrong.

Ah, I do love zombie comments, where someone has changed the code but 
left the comments as  they were.

It's my favourite source of new curses.

William Hyde
Re: “The end of software secrecy is almost upon us"
#89
Author: Chris M. Thomasson
Date: Tue, 20 Oct 2026 23:48
42 lines
3660 bytes
On 10/20/2026 1:41 PM, Scott Dorsey wrote:
> Johann 'Myrkraverk' Oskarsson  <johann@myrkraverk.invalid> wrote:
>> On 10/20/2026 9:39 PM, Scott Dorsey wrote:
>>> Because I want my code to run fast!  I do very much seem to be in the
>>> minority today, it is true.
>>
>> I presume you're working on some /hot code/, and will comment according-
>> ly.
> 
> It's not super hot, but it's often pretty dense dsp stuff and requires
> extensive commenting to describe exactly what equations are for and how
> they are being used.
> 
> Unfortunately so much of the code I deal with has comments like
> 
> C      BRAINDAMAGE!  ROCKWELL-COLLINS BRAINDAMAGE!
> 
> Which are expressive and they are good warnings that something is about
> to follow which has to do with hardware design deficiencies but not
> actually very informative about what they are.
> 
>> I've come across complaints -- that I don't have handy -- that compilers
>> sometimes under-optimize, or otherwise cannot be told to do the right
>> thing.  One memorable complaint was the inability of then-GCC to align
>> a specific loop to the cache -- I believe a 16 byte boundary -- it was
>> only everything -- with the resulting drop in performance everywhere
>> else -- or nothing because there was no #pragma nor [[attribute]] to say
>> /this loop needs to be cache aligned/.
> 
> There used to be a lot of complaints like that around here, but these
> days gcc is so much better than it was even a decade ago.  The new
> gfortran is not perfect but it's entirely acceptable and takes advantage
> of the good backend developed for gcc.  The older g77 was excruciating.
> I'd read the .a files that came out and just want to hit my head on the
> desk.
> 
>> What do you do in these circumstances?  Has this happened to you at all?
> 
> I go home and I have a drink and I try not to think about it.  Yes, it
> could run a lot better but....
A drink? Ahh some brain coolants. Well, they are needed from time to 
time... ;^D
Re: “The end of software secrecy is almost upon
#90
Author: Nuno Silva
Date: Wed, 21 Oct 2026 00:15
50 lines
3619 bytes
On 2026-10-20, Charlie Gibbs wrote:

> On 2026-10-20, boltar@battlestar.co.uk <boltar@battlestar.co.uk> wrote:
>
>> On Tue, 20 Oct 2026 13:20:40 -0400
>>
>> Cryptoengineer <petertrei@gmail.com> wrote:
>>
>>> On 10/20/2026 1:46 AM, Titus G wrote:
>>>
>>>> I thought that what was called Structured Programming became an
>>>> inviolable law when invented by whom I do not know but suspect that
>>>> bugger for the bottle or even earlier.
>>>
>>> ITYM:
>>>
>>> Edgar Dijkstra: Go To Statement Considered Harmful
>>
>> A man who clearly never programmed in assembler.
>
> Of course.  He was a CS weenie - any mention of low-level
> programming makes those types turn purple.
>
> Although Structured Programming introduced some good concepts,
> it also built a following of fanatics more bent on crucifying
> infidels than writing good practical programs.  Some people
> came to see the number of function calls a program made as
> a figure of merit, resulting in dozens of tiny functions that
> caused control to jump all over the place (which made virtual
> memory systems thrash).  And the end result wasn't that much
> more readable.
>
> The undisciplined use of GOTOs is bad, agreed.  But the
> undisciplined use of function calls isn't a whole lot better.
> After all, a function call is just a GOTO paired with a
> "come from", so in the end it's all still spaghetti code -
> it's just that the "structured" code runs double strands.

The "come from" IIRC is the key part here. If you use a function (and
don't goto into its body, as that would undo the benefit here), you can
analyze the function as a block with clearly defined flows and
separately from the rest of the program.

The criticism isn't about not putting everything into its own function,
it's about how using functions and other flow control structures instead
of e.g. gotos makes it easier to study and reason about these parts of
the code.

-- 
Nuno Silva
Re: “The end of software secrecy is almost upon
#92
Author: Lawrence D’Oliveiro
Date: Wed, 21 Oct 2026 01:27
18 lines
2544 bytes
On Tue, 20 Oct 2026 23:18:44 GMT, Charlie Gibbs wrote:

> On 2026-10-20, Lawrence D’Oliveiro <ldo@nz.invalid> wrote:
>
>> I find the C code I write tends to do a lot of dynamic resource
>> allocations. These can sometimes fail with errors. So error
>> recovery will invariably involve cleaning up those parts of the
>> allocations which already succeeded. Gotos are no good for this;
>> you need to exit levels of structure nesting one by one, disposing
>> of allocations as you go.
>
> I know that a lot of CS types are going to stick pins into little
> dolls that look like me for saying this, but IMHO resource pointers,
> handles, etc. should be global.

Surely any variable which is only used locally to a particular block
should be declared local to that block. Why should resource pointers
be any different?
Re: “The end of software secrecy is almost upon
#91
Author: Lawrence D’Oliveiro
Date: Wed, 21 Oct 2026 01:29
7 lines
1896 bytes
On Tue, 20 Oct 2026 17:24:27 -0000 (UTC), boltar wrote:

> ** The setting a flag method which has to be checked in every nested
>    loop test is just an [asinine] way to code.

If you have to do cleanup at each level before exiting, then it works
perfectly well.
Re: “The end of software secrecy is almost upon us"
#93
Author: Lawrence D’Oliveiro
Date: Wed, 21 Oct 2026 01:30
10 lines
2011 bytes
On Tue, 20 Oct 2026 17:15:28 -0000 (UTC), Thomas Koenig wrote:

> But the attitude of not caring about speed can have grave results
> when the inefficiencies pile up.

That’s not usually how code works, though. Execution time tends to
follow a Pareto distribution -- spend your effort on the 10% of the
code where 90% of the time is being spent, and that gives significant
improvements without having to mess around with the other 90% of the
code.
Re: “The end of software secrecy is almost upon us"
#94
Author: Lawrence D’Oliveiro
Date: Wed, 21 Oct 2026 01:35
18 lines
2335 bytes
On Tue, 20 Oct 2026 15:20:29 -0500, Lynn McGuire wrote:

> Most of our convergence methods use Newton-Raphson, yes that Isaac
> Newton, to start, very quick to solve if it solves.

Second-order convergence. That is, the number of digits of precision
roughly doubles on every iteration -- when it works, that is.

> If that spirals out of control then we use the halving method, brute
> force and very slow. If that fails then we use an interpolation
> method, also very slow. If that fails (the flash is infeasible),
> then we report the failure to the user.

Binary chop gives only first-order convergence, but it is guaranteed
to converge if there is an answer. That’s why it’s always the last
resort.

No love for Runge-Kutta?
Re: “The end of software secrecy is almost upon
#95
Author: Keith Thompson
Date: Wed, 21 Oct 2026 02:06
22 lines
2382 bytes
David Brown <david.brown@hesbynett.no> writes:
[...]
> Multi-level break and continue (named loops) is on its way to C++, and
> will almost certainly be accepted sooner or later (since it is already
> in the draft of the next C standard):
>
> <https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3568r0.html>

Named break and continue are in the latest C2y draft:

https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3886.pdf

They have been proposed for C++, but as far as I can tell have not
(yet?) been incorporated into a draft C++ standard.

https://github.com/cplusplus/draft

[...]

-- 
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */
Re: “The end of software secrecy is almost upon us"
#96
Author: Titus G
Date: Wed, 21 Oct 2026 03:11
40 lines
3337 bytes
On 21/10/2026 06:20, Cryptoengineer wrote:
> On 10/20/2026 1:46 AM, Titus G wrote:
>> On 20/10/2026 18:28, Thomas Koenig wrote:
>>> Scott Dorsey <kludge@panix.com> schrieb:
>>>> Lynn McGuire  <lynnmcguire5@gmail.com> wrote:
>>>>> One of the things that I am enjoying is that F2C gets rid of about 75%
>>>>> of the Fortran Gotos.  The remaining 25% Gotos usually make some
>>>>> sense.
>>>>> Ok, a little sense that any C or C++ programmer would have never
>>>>> used a
>>>>> goto there.
>>>>
>>>> It drives me up the wall when people use a goto to jump out of a do
>>>> loop.
>>>> The compiler is doing so much cleanup work that the programmer never
>>>> sees.
>>>
>>> Again, care to give an example?
>>
>> I thought that what was called Structured Programming became an
>> inviolable law when invented by whom I do not know but suspect that
>> bugger for the bottle or even earlier.
> 
> ITYM:
> 
> Edgar Dijkstra: Go To Statement Considered Harmful
> 
> https://homepages.cwi.nl/~storm/teaching/reader/Dijkstra68.pdf
> 
> pt

Not Aristotle but the date on that PDF was 1968.
Initially we used to write spaghetti in Burroughs Assembler and machine
language but after less than a year of my employment, newer larger
hardware including a reliable hard disk was purchased by the commercial
bureau and everything was rewritten using Structured Programming and
COBOL which had a marvellously fast file indexing system and it became
possible to read other programmers' programs with such advantages being
great for the bureau but not so demanding and therefore rewarding for
programmers.
Re: “The end of software secrecy is almost upon
#97
Author: Charlie Gibbs
Date: Wed, 21 Oct 2026 03:22
28 lines
2984 bytes
On 2026-10-21, Lawrence D’Oliveiro <ldo@nz.invalid> wrote:

> On Tue, 20 Oct 2026 23:18:44 GMT, Charlie Gibbs wrote:
>
>> I know that a lot of CS types are going to stick pins into little
>> dolls that look like me for saying this, but IMHO resource pointers,
>> handles, etc. should be global.
>
> Surely any variable which is only used locally to a particular block
> should be declared local to that block. Why should resource pointers
> be any different?

Many resource pointers aren't local, though.  Consider a program
which loads a table from a file, then uses it for lookups while
processing data in another file.  You might decompose the program
into a function that loads the table, and another that performs
lookups.  The main routine calls the table load routine, and opens
the file to be processed.  It then loops reading records, calling
the lookup function each time.  The table, dynamically allocated by
the table load function, must remain allocated when the allocator
exits, and must be available to the lookup function on each call;
it cannot be local to either of those functions.

-- 
/~\  Charlie Gibbs                  |  In this world there are
\ /  <cgibbs@kltpzyxm.invalid>      |  two kinds of people:
 X   I'm really at ac.dekanfrus     |  1. Those who can extrapolate
/ \  if you read it the right way.  |  from incomplete data.
Re: Re: “The end of software secrecy is almost upon
#98
Author: John Levine
Date: Wed, 21 Oct 2026 03:31
10 lines
1794 bytes
According to William Hyde  <wthyde1953@gmail.com>:
>Ah, I do love zombie comments, where someone has changed the code but 
>left the comments as  they were.

     i += 2;    /* add 1 to i */

-- 
Regards,
John Levine, johnl@taugh.com, Primary Perpetrator of "The Internet for Dummies",
Please consider the environment before reading this e-mail. https://jl.ly
Re: Re: “The end of software secrecy is almost upon
#99
Author: Ted Nolan <tednolan>
Date: Wed, 21 Oct 2026 04:31
12 lines
1473 bytes
In article <11b9bn2$28tm$2@gal.iecc.com>, John Levine  <johnl@taugh.com> wrote:
>According to William Hyde  <wthyde1953@gmail.com>:
>>Ah, I do love zombie comments, where someone has changed the code but 
>>left the comments as  they were.
>
>     i += 2;    /* add 1 to i */
>

And then you find out it *does* add 1 to i.  Somehow.
-- 
columbiaclosings.com
What's not in Columbia anymore..
Re: “The end of software secrecy is almost upon
#100
Author: Lawrence D’Oliveiro
Date: Wed, 21 Oct 2026 05:35
29 lines
3216 bytes
On Wed, 21 Oct 2026 03:22:12 GMT, Charlie Gibbs wrote:

> On 2026-10-21, Lawrence D’Oliveiro <ldo@nz.invalid> wrote:
>
>> On Tue, 20 Oct 2026 23:18:44 GMT, Charlie Gibbs wrote:
>>
>>> I know that a lot of CS types are going to stick pins into little
>>> dolls that look like me for saying this, but IMHO resource
>>> pointers, handles, etc. should be global.
>>
>> Surely any variable which is only used locally to a particular
>> block should be declared local to that block. Why should resource
>> pointers be any different?
>
> Many resource pointers aren't local, though. Consider a program
> which loads a table from a file, then uses it for lookups while
> processing data in another file. You might decompose the program
> into a function that loads the table, and another that performs
> lookups. The main routine calls the table load routine, and opens
> the file to be processed. It then loops reading records, calling the
> lookup function each time. The table, dynamically allocated by the
> table load function, must remain allocated when the allocator exits,
> and must be available to the lookup function on each call; it cannot
> be local to either of those functions.

This is why OO was invented. You instantiate a Table instance, and
that loads the table contents. Call the lookup method on the instance
as many times as you need. Then, when finished with the Table
instance, dispose of it.
Re: “The end of software secrecy is almost upon us"
#101
Author: Lawrence D’Oliveiro
Date: Wed, 21 Oct 2026 05:37
11 lines
2142 bytes
On Wed, 21 Oct 2026 16:11:28 +1300, Titus G wrote:

> ... everything was rewritten using Structured Programming and COBOL
> which had a marvellously fast file indexing system and it became
> possible to read other programmers' programs with such advantages
> being great for the bureau but not so demanding and therefore
> rewarding for programmers.

But then, business procedures moved away from ISAM files to embrace
relational databases instead, and it turned out COBOL was a poor fit
for managing SQL queries.
Re: “The end of software secrecy is almost upon
#102
Author: boltar
Date: Wed, 21 Oct 2026 07:42
15 lines
2089 bytes
On Wed, 21 Oct 2026 01:29:18 -0000 (UTC)
Lawrence =?iso-8859-13?q?D=FFOliveiro?= <ldo@nz.invalid> wrote:
>On Tue, 20 Oct 2026 17:24:27 -0000 (UTC), boltar wrote:
>
>> ** The setting a flag method which has to be checked in every nested
>>    loop test is just an [asinine] way to code.
>
>If you have to do cleanup at each level before exiting, then it works
>perfectly well.

It may well work but it doesn't make it good. Its harder to follow - whereas
a goto out of a deeply nested loops is blindingly obvious - and its less
efficient. 

Re: Re: “The end of software secrecy is almost upon
#103
Author: boltar
Date: Wed, 21 Oct 2026 07:47
37 lines
3091 bytes
On Tue, 20 Oct 2026 20:50:58 +0200
David Brown <david.brown@hesbynett.no> wrote:
>On 20/10/2026 19:24, boltar@battlestar.co.uk wrote:
>> If C/C++ had multi level break and continue keywords goto would almost
>> never be needed**. There's no reason they can't be added - along with a lot
>of
>> other useful but basic fatures (eg non POD switch, native concatting numbers
>to
>> std::string without calling to_string) - but I guess the committee are too
>busy
>> circle jerking with esoteric crap no one will ever use (eg concepts) to
>bother.
>> 
>
>Multi-level break and continue (named loops) is on its way to C++, and 
>will almost certainly be accepted sooner or later (since it is already 
>in the draft of the next C standard):

They should have been added 30 years ago.

>And people /do/ use concepts, even if you do not.

Yeah, on university CS courses. They're just more metaprogramming fucking
about and add nothing of actual value for the jobbing programmer trying to
solve a problem.

>You might want to do some research before insulting the people who are 
>actually doing the work in driving languages forward.

Driving it forward into a ditch. The language is already so needlessly
complicated that students just swerve it for more user friendly ones, mainly
Python. And Rust is already nudging C aside. If they ever add a decent object 
model to it then C++ will be next in the firing line.

If I was starting out today in IT I wouldn't touch C++ with the proverbial
barge pole.
Re: “The end of software secrecy is almost upon
#104
Author: Lawrence D’Oliveiro
Date: Wed, 21 Oct 2026 07:55
20 lines
2366 bytes
On Wed, 21 Oct 2026 07:42:30 -0000 (UTC), boltar wrote:

> On Wed, 21 Oct 2026 01:29:18 -0000 (UTC), Lawrence D’Oliveiro wrote:
>>
>> On Tue, 20 Oct 2026 17:24:27 -0000 (UTC), boltar wrote:
>>
>>> ** The setting a flag method which has to be checked in every
>>>    nested loop test is just an [asinine] way to code.
>>
>> If you have to do cleanup at each level before exiting, then it
>> works perfectly well.
>
> It may well work but it doesn't make it good. Its harder to follow -
> whereas a goto out of a deeply nested loops is blindingly obvious -
> and its less efficient.

The goto from the deep inner block to the outer one is “blindingly
obvious” ... ly wrong.

What about the cleanup?
Page 2 of 11 • 514 total messages
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads