[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Why is break not syntactically required to be the last statement in a block (anymore)?
- From: Lorenzo Donati <lorenzodonatibz@...>
- Date: Sat, 30 Jul 2022 11:40:43 +0200
On 29/07/2022 16:58, Scott Morgan wrote:
On 29/07/2022 15:23, Lorenzo Donati wrote:
My scenario is about an algorithm that *inherently* needs some
degree of deep nesting to be efficient and more readable (some
funky math algos are that ways). So I assume that whoever has
written the implementation has already eliminated unneeded nesting
levels and what is left is the "most" clear and efficient
implementation.
Out of interest, do you have any examples? The idea of needing these
awkward constructs makes my teeth itch, but I can believe there must
be some code that needs it.
As I said in one of my earlier posts, I am somewhat rambling :-)
Hence I have no ready example at hand, but I have vague recollections
(some 25+ yrs ago!! when I was "exposed" to things like EM simulations,
FFT algorithms (multidimensional FFT especially) and other communication
system math stuff [1]) of nasty 4-level-deep core algorithms, where
every efficiency was paramount (and code could get more convoluted when
dealing with multidimensional arrays with more dimensions).
Everything was in C or C++ and goto+label was the obvious way to
bail-out from an inner loop.
Probably today that stuff would be programmed in a parallel fashion and
wouldn't need so much levels, I guess.
BTW, I think I've seen some deeply nested stuff in crypto algorithms,
more recently, but I'm no longer a professional programmer, so I may
remember incorrectly some snippet found here and there in programming
forums (I wasn't involved in those things).
Reveal the horrors please :)
You really wouldn't want to watch those eldritch horrors in the face! :-)
Scott
-- Lorenzo
[1] Here is a link to a paper where there are some formulas that
somewhat resemble what I remember. Of course the content is focused on
modern machines and funky hardware SIMD instructions, but I just
searched for something which could show you the kind of formulas that I
had in mind.
https://jcst.ict.ac.cn/CN/article/downloadArticleFile.do?attachType=PDF&id=2092
And this is a link to a downloadable book from Purdue University about
computational EM stuff. If you delve in it you'll find plenty of
horrors! :-)
https://engineering.purdue.edu/wcchew/Chew_Jin_Michielssen_Song_CEMBOOK_Final.pdf
- References:
- Why is break not syntactically required to be the last statement in a block (anymore)?, Lars Müller
- Re: Why is break not syntactically required to be the last statement in a block (anymore)?, Egor Skriptunoff
- Re: Why is break not syntactically required to be the last statement in a block (anymore)?, Lorenzo Donati
- Re: Why is break not syntactically required to be the last statement in a block (anymore)?, Egor Skriptunoff
- Re: Why is break not syntactically required to be the last statement in a block (anymore)?, Lorenzo Donati
- Re: Why is break not syntactically required to be the last statement in a block (anymore)?, Egor Skriptunoff
- Re: Why is break not syntactically required to be the last statement in a block (anymore)?, Lorenzo Donati
- Re: Why is break not syntactically required to be the last statement in a block (anymore)?, Sean Conner
- Re: Why is break not syntactically required to be the last statement in a block (anymore)?, Lorenzo Donati
- Re: Why is break not syntactically required to be the last statement in a block (anymore)?, Scott Morgan