Re: Computer architects leaving Intel...

Liste des GroupesRevenir à c arch 
Sujet : Re: Computer architects leaving Intel...
De : gneuner2 (at) *nospam* comcast.net (George Neuner)
Groupes : comp.arch
Date : 02. Sep 2024, 06:08:21
Autres entêtes
Organisation : i2pn2 (i2pn.org)
Message-ID : <8lcadjhnlcj5se1hrmo232viiccjk5alu4@4ax.com>
References : 1 2 3 4 5 6 7 8 9 10
User-Agent : ForteAgent/8.00.32.1272
On Sun, 1 Sep 2024 22:07:53 +0200, David Brown
<david.brown@hesbynett.no> wrote:

On 31/08/2024 21:08, Thomas Koenig wrote:
Anton Ertl <anton@mips.complang.tuwien.ac.at> schrieb:
 
Of course the fans of compilers that do what nobody means found a
counterargument long ago: They claim that compilers would need psychic
powers to know what you mean.
 
Of course, different compiler writers have different opinions, but
what you write is very close to a straw man argument.
 
What compiler writers generlly agree upon is that specifications
matter (either in the language standard or in documented behavior
of the compiler).  Howewer, the concept of a  specification is
something that you do not appear to understand, and maybe never
will.
 
An example: I work in the chemical industry.  If a pressure vessel
is rated for 16 bar overpressure, we are not allowed to run it at
32 bar. If the supplier happens to have sold vessels which can
actually withstand 32 bar, and then makes modifications which
lower the actual pressure the vessel can withstand only 16 bar,
the customer has no cause for complaint.
 
As usual, the specification goes both ways:  The supplier
guarantees the pressure rating, and the customer is obliged
(by law, in this case) to never operate the vessel above its
pressure rating.  Hence, safety valves rupture discs.
>
That is very well put.
>
Specifications are an agreement between the supplier and the client.
The supplier promises particular functionality if the client stays
within those specifications.  It is how things work in a huge range of
aspects of life.  Sometimes there are agreements in place for what
happens if the specifications are broken (fine if you fail to deliver as
promised, jail sentence if you break the law, etc.), but these are
really just extensions of the agreement and specification.
>
If we think about computing, we can start with mathematics for examples.
 A mathematical function maps one set onto another - it specifies what
value in the output set is produced from each value in the input set.
It does not specify the result for values that are not in the input set,
even if they are in a "reasonable" superset.  So the real square root
function specifies an output for all non-negative real numbers - it does
not specify the result for negative real numbers.  Attempting to find
the square root of a negative number is undefined behaviour.
>
Functions in computing are the same.  You have a specification - a
pre-condition, and a post-condition.  The inputs (including the
environment, if that is relevant) has to satisfy the pre-condition, and
then the function guarantees that the post-condition will hold after the
function call.  Try to put anything else into the function without
satisfying the pre-condition, and it's garbage in, garbage out.  If you
don't understand "garbage in, garbage out", you really don't understand
the first thing about software development.  This has been understood
since the beginning of the programmable computer:
>
"""
On two occasions I have been asked, 'Pray, Mr. Babbage, if you put into
the machine wrong figures, will the right answers come out?' I am not
able rightly to apprehend the kind of confusion of ideas that could
provoke such a question.
"""
>
>
In the context of compilers, the specification is the language standard
in use at the time, combined with the specifications of any library
functions or other code being used.  If you don't follow those
specifications - your input code does not meet the pre-conditions, or
the pre-conditions are not met when your code is run - you get undefined
behaviour.  There is no rational way to expect any particular result
when the input is in essence meaningless.
>
>
So if there is a function (or operator, or other feature) specified by
the language or by library or function documentation, and you pass it
something that is not documented as fulfilling the pre-conditions, it's
garbage in, garbage out - your code is wrong.  If your code makes
assumptions about the workings of a function that are not specified in
its post-condition, the code is wrong.  It might work during testing,
but it is not guaranteed to work.  If you try to use a function outside
its specifications, then your code is wrong.
>
>
Of course it is not always easy to make sure everything is correct
within specifications.  Programming languages and libraries are
complicated, and people make mistakes.  And where practical, it can be
good to take that into consideration - if it is possible to give error
messages or help in the case of bad inputs, then that can be very
helpful to people.  But it doesn't make sense to try to give the "right"
output for wrong input.  And it doesn't make sense to do this to the
significant detriment of efficiency with correct inputs.
>
To compare this to specifications in other walks of life, imagine an
electricity company.  The specification they provide to you, the
customer, has the pre-condition that you pay your bills.  The
post-condition is that you get electricity.  If you break the
specification - you stop paying your bills - it's perfectly reasonable
that they cut off your electricity.  But it is /nice/ if they first send
you warning letters, and offers to re-arrange your debt.  But if you are
following the specifications and paying your bills, you would not want
the electricity company to keep providing electricity to those who don't
pay, because that would mean /you/ would have to pay more.
>
In the same way, I want my compiler to warn about potential problems or
undefined behaviour when it reasonably can, rather than jumping straight
to nasal daemons.  But I don't want it to generate slower code that it
otherwise could, just because some people might write incorrect code.  I
should not have to pay (in run-time efficiency losses) for other
people's potential failure to follow specifications.
>
But I am quite happy to have compiler options to control the balance and
behaviour.  Compilers generally do little optimisation without flags
explicitly enabling them.  And some compilers have flags to change the
language specifications (such as making signed integer arithmetic wrap).
 There's not a lot they could do better to satisfy people who want the
tools to conform to their imagined specification rather than the actual
specifications.
>
I suppose one thing they could do is that when a new compiler version
comes out with new optimisations, they could have a flag that turns
these off even if you have enabled others.  Maybe you could have
"-olimit=8" to say "limit optimisations to those in gcc 8".  That might
give fewer surprises to people who have got their code wrong.
>

I'm not going to argue about whether UB in code is wrong.  The
question I have concerns what to do with something that explicitly is
mentioned as UB in some standard N, but was not addressed in previous
standards.

Was it always UB?  Or should it be considered ID until it became UB?


It does seem to me that as the C standard evolved, and as more things
have *explicitly* become documented as UB, compiler developers have
responded largely by dropping whatever the compiler did previously -
sometimes breaking code that relied on it.

I have moved on from C (mostly), and I learned long ago to archive
toolchains and to expect that any new version of a tool might break
something that worked previously.  I don't like it, but it generally
doesn't annoy me that much.


MMV. Certainly Anton's does. ;-)

Similar to you (David), I came from a - not embedded per se - but
kiosk background:  HRT indrustrial QA/QC systems.  I know well the
attraction of a new compiler yielding better performing code.  I also
know a large amount of my code was hardware and OS specific, that
those are the things beyond the scope of the compiler, but they also
are things that I don't want to have to revisit every time a new
version of the compiler is released.

13 of one, baker's dozen of the other.

Date Sujet#  Auteur
27 Aug 24 * Computer architects leaving Intel...529Thomas Koenig
27 Aug 24 +- Re: Computer architects leaving Intel...1Michael S
27 Aug 24 +- Re: Computer architects leaving Intel...1Stephen Fuld
27 Aug 24 `* Re: Computer architects leaving Intel...526John Dallman
28 Aug 24  +* Re: Computer architects leaving Intel...519BGB
28 Aug 24  i`* Re: Computer architects leaving Intel...518MitchAlsup1
28 Aug 24  i `* Re: Computer architects leaving Intel...517BGB
28 Aug 24  i  +* Re: Computer architects leaving Intel...2Robert Finch
28 Aug 24  i  i`- Re: Computer architects leaving Intel...1BGB
28 Aug 24  i  `* Re: Computer architects leaving Intel...514MitchAlsup1
29 Aug 24  i   `* Re: Computer architects leaving Intel...513BGB
29 Aug 24  i    +* Re: Computer architects leaving Intel...501MitchAlsup1
29 Aug 24  i    i`* Re: Computer architects leaving Intel...500BGB
30 Aug 24  i    i +* Re: Computer architects leaving Intel...489John Dallman
30 Aug 24  i    i i+* Re: Computer architects leaving Intel...11Thomas Koenig
30 Aug 24  i    i ii+- Re: Computer architects leaving Intel...1Michael S
30 Aug 24  i    i ii+* Re: Computer architects leaving Intel...8Anton Ertl
30 Aug 24  i    i iii+* Re: Computer architects leaving Intel...2Michael S
30 Aug 24  i    i iiii`- Re: Computer architects leaving Intel...1Anton Ertl
30 Aug 24  i    i iii`* Re: Computer architects leaving Intel...5John Dallman
30 Aug 24  i    i iii `* Re: Computer architects leaving Intel...4Brett
30 Aug 24  i    i iii  +- Re: Computer architects leaving Intel...1John Dallman
2 Sep 24  i    i iii  `* Re: Computer architects leaving Intel...2Terje Mathisen
2 Sep 24  i    i iii   `- Re: Computer architects leaving Intel...1Thomas Koenig
30 Aug 24  i    i ii`- Re: Computer architects leaving Intel...1BGB
30 Aug 24  i    i i`* Re: Computer architects leaving Intel...477Anton Ertl
30 Aug 24  i    i i +* Re: Computer architects leaving Intel...301John Dallman
30 Aug 24  i    i i i`* Re: Computer architects leaving Intel...300David Brown
30 Aug 24  i    i i i +* Re: Computer architects leaving Intel...292Anton Ertl
30 Aug 24  i    i i i i`* Re: Computer architects leaving Intel...291Bernd Linsel
31 Aug 24  i    i i i i +- Re: Computer architects leaving Intel...1Thomas Koenig
31 Aug 24  i    i i i i `* Re: Computer architects leaving Intel...289Thomas Koenig
31 Aug 24  i    i i i i  +- Re: Computer architects leaving Intel...1Thomas Koenig
31 Aug 24  i    i i i i  `* Re: Computer architects leaving Intel...287Bernd Linsel
31 Aug 24  i    i i i i   +- Re: Computer architects leaving Intel...1Thomas Koenig
31 Aug 24  i    i i i i   +* Re: Computer architects leaving Intel...2Thomas Koenig
31 Aug 24  i    i i i i   i`- Re: Computer architects leaving Intel...1Bernd Linsel
31 Aug 24  i    i i i i   `* Re: Computer architects leaving Intel...283Anton Ertl
31 Aug 24  i    i i i i    +* Re: Computer architects leaving Intel...278Thomas Koenig
31 Aug 24  i    i i i i    i+* Re: Computer architects leaving Intel...157Bernd Linsel
31 Aug 24  i    i i i i    ii+* Re: Computer architects leaving Intel...153MitchAlsup1
1 Sep 24  i    i i i i    iii`* Re: Computer architects leaving Intel...152Stephen Fuld
2 Sep 24  i    i i i i    iii `* Re: Computer architects leaving Intel...151Terje Mathisen
2 Sep 24  i    i i i i    iii  `* Re: Computer architects leaving Intel...150Stephen Fuld
3 Sep 24  i    i i i i    iii   +* Re: Computer architects leaving Intel...139David Brown
3 Sep 24  i    i i i i    iii   i+* Re: Computer architects leaving Intel...108Stephen Fuld
4 Sep 24  i    i i i i    iii   ii`* Re: Computer architects leaving Intel...107David Brown
4 Sep 24  i    i i i i    iii   ii +* Re: Computer architects leaving Intel...103Terje Mathisen
4 Sep 24  i    i i i i    iii   ii i+* Re: Computer architects leaving Intel...101David Brown
4 Sep 24  i    i i i i    iii   ii ii+* Re: Computer architects leaving Intel...97jseigh
4 Sep 24  i    i i i i    iii   ii iii`* Re: Computer architects leaving Intel...96David Brown
4 Sep 24  i    i i i i    iii   ii iii `* Re: Computer architects leaving Intel...95Brett
4 Sep 24  i    i i i i    iii   ii iii  +- Re: Computer architects leaving Intel...1Thomas Koenig
4 Sep 24  i    i i i i    iii   ii iii  +- Re: Computer architects leaving Intel...1MitchAlsup1
5 Sep 24  i    i i i i    iii   ii iii  +* Re: Computer architects leaving Intel...8BGB
5 Sep 24  i    i i i i    iii   ii iii  i`* Re: Computer architects leaving Intel...7MitchAlsup1
5 Sep 24  i    i i i i    iii   ii iii  i `* Re: Computer architects leaving Intel...6David Brown
5 Sep 24  i    i i i i    iii   ii iii  i  `* Re: Computer architects leaving Intel...5Niklas Holsti
5 Sep 24  i    i i i i    iii   ii iii  i   `* Re: Computer architects leaving Intel...4David Brown
6 Sep 24  i    i i i i    iii   ii iii  i    `* Re: Computer architects leaving Intel...3BGB
6 Sep 24  i    i i i i    iii   ii iii  i     `* Re: Computer architects leaving Intel...2David Brown
9 Sep 24  i    i i i i    iii   ii iii  i      `- Re: Computer architects leaving Intel...1BGB
5 Sep 24  i    i i i i    iii   ii iii  +* Re: Computer architects leaving Intel...83David Brown
5 Sep 24  i    i i i i    iii   ii iii  i`* Re: Computer architects leaving Intel...82Terje Mathisen
5 Sep 24  i    i i i i    iii   ii iii  i +* Re: Computer architects leaving Intel...79David Brown
5 Sep 24  i    i i i i    iii   ii iii  i i+* Re: Computer architects leaving Intel...2Thomas Koenig
7 Sep 24  i    i i i i    iii   ii iii  i ii`- Re: Computer architects leaving Intel...1Tim Rentsch
5 Sep 24  i    i i i i    iii   ii iii  i i+* Re: Computer architects leaving Intel...74Terje Mathisen
5 Sep 24  i    i i i i    iii   ii iii  i ii+* Re: Computer architects leaving Intel...16David Brown
9 Sep 24  i    i i i i    iii   ii iii  i iii`* Re: Computer architects leaving Intel...15Terje Mathisen
9 Sep 24  i    i i i i    iii   ii iii  i iii +* Re: Computer architects leaving Intel...12David Brown
9 Sep 24  i    i i i i    iii   ii iii  i iii i`* Re: Computer architects leaving Intel...11Brett
10 Sep 24  i    i i i i    iii   ii iii  i iii i +* Re: Computer architects leaving Intel...5Terje Mathisen
10 Sep 24  i    i i i i    iii   ii iii  i iii i i`* Re: Computer architects leaving Intel...4Brett
10 Sep 24  i    i i i i    iii   ii iii  i iii i i +* Re: Computer architects leaving Intel...2Michael S
11 Sep 24  i    i i i i    iii   ii iii  i iii i i i`- Re: Computer architects leaving Intel...1Brett
11 Sep 24  i    i i i i    iii   ii iii  i iii i i `- Re: Computer architects leaving Intel...1Terje Mathisen
10 Sep 24  i    i i i i    iii   ii iii  i iii i `* Re: Computer architects leaving Intel...5David Brown
10 Sep 24  i    i i i i    iii   ii iii  i iii i  +* Re: Computer architects leaving Intel...3Anton Ertl
10 Sep 24  i    i i i i    iii   ii iii  i iii i  i`* Re: Computer architects leaving Intel...2David Brown
10 Sep 24  i    i i i i    iii   ii iii  i iii i  i `- Re: Computer architects leaving Intel...1Stefan Monnier
10 Sep 24  i    i i i i    iii   ii iii  i iii i  `- Re: Computer architects leaving Intel...1BGB
9 Sep 24  i    i i i i    iii   ii iii  i iii `* Re: Computer architects leaving Intel...2Michael S
10 Sep 24  i    i i i i    iii   ii iii  i iii  `- Re: Computer architects leaving Intel...1Michael S
5 Sep 24  i    i i i i    iii   ii iii  i ii+* Re: Computer architects leaving Intel...45Bernd Linsel
6 Sep 24  i    i i i i    iii   ii iii  i iii+- Re: Computer architects leaving Intel...1David Brown
9 Sep 24  i    i i i i    iii   ii iii  i iii+* Re: Computer architects leaving Intel...2Terje Mathisen
9 Sep 24  i    i i i i    iii   ii iii  i iiii`- Re: Computer architects leaving Intel...1Tim Rentsch
14 Sep15:08  i    i i i i    iii   ii iii  i iii`* Re: Computer architects leaving Intel...41Kent Dickey
14 Sep15:26  i    i i i i    iii   ii iii  i iii +* Re: Computer architects leaving Intel...32Anton Ertl
14 Sep21:11  i    i i i i    iii   ii iii  i iii i+* Re: Computer architects leaving Intel...29MitchAlsup1
14 Sep21:26  i    i i i i    iii   ii iii  i iii ii`* Re: Computer architects leaving Intel...28Thomas Koenig
15 Sep17:50  i    i i i i    iii   ii iii  i iii ii `* Re: Computer architects leaving Intel...27David Brown
16 Sep09:17  i    i i i i    iii   ii iii  i iii ii  +* Re: Computer architects leaving Intel...5Thomas Koenig
16 Sep14:45  i    i i i i    iii   ii iii  i iii ii  i`* Re: Computer architects leaving Intel...4David Brown
16 Sep22:15  i    i i i i    iii   ii iii  i iii ii  i `* Re: Computer architects leaving Intel...3Thomas Koenig
17 Sep03:49  i    i i i i    iii   ii iii  i iii ii  i  +- Re: Upwards and downwards compatible, Computer architects leaving Intel...1John Levine
17 Sep11:15  i    i i i i    iii   ii iii  i iii ii  i  `- Re: Computer architects leaving Intel...1David Brown
16 Sep10:37  i    i i i i    iii   ii iii  i iii ii  `* Re: Computer architects leaving Intel...21Terje Mathisen
16 Sep14:48  i    i i i i    iii   ii iii  i iii ii   `* Re: Computer architects leaving Intel...20David Brown
16 Sep15:04  i    i i i i    iii   ii iii  i iii ii    +* Re: Computer architects leaving Intel...14Michael S
17 Sep08:07  i    i i i i    iii   ii iii  i iii ii    `* Re: Computer architects leaving Intel...5Terje Mathisen
15 Sep06:42  i    i i i i    iii   ii iii  i iii i`* Re: Computer architects leaving Intel...2BGB
14 Sep21:00  i    i i i i    iii   ii iii  i iii +* Re: Computer architects leaving Intel...3Thomas Koenig
16 Sep03:32  i    i i i i    iii   ii iii  i iii `* Re: Computer architects leaving Intel...5Tim Rentsch
6 Sep 24  i    i i i i    iii   ii iii  i ii+* Re: Computer architects leaving Intel...3Tim Rentsch
7 Sep 24  i    i i i i    iii   ii iii  i ii`* Re: Computer architects leaving Intel...9Chris M. Thomasson
5 Sep 24  i    i i i i    iii   ii iii  i i`* Re: Computer architects leaving Intel...2MitchAlsup1
5 Sep 24  i    i i i i    iii   ii iii  i `* Re: Computer architects leaving Intel...2MitchAlsup1
7 Sep 24  i    i i i i    iii   ii iii  `- Re: Computer architects leaving Intel...1Tim Rentsch
4 Sep 24  i    i i i i    iii   ii ii`* Re: Computer architects leaving Intel...3Thomas Koenig
6 Sep 24  i    i i i i    iii   ii i`- Re: Computer architects leaving Intel...1Chris M. Thomasson
4 Sep 24  i    i i i i    iii   ii +- Re: Computer architects leaving Intel...1jseigh
13 Sep 24  i    i i i i    iii   ii `* Re: Computer architects leaving Intel...2Stephen Fuld
3 Sep 24  i    i i i i    iii   i`* Re: Computer architects leaving Intel...30Stefan Monnier
3 Sep 24  i    i i i i    iii   `* Re: Computer architects leaving Intel...10Terje Mathisen
31 Aug 24  i    i i i i    ii`* Re: Computer architects leaving Intel...3Thomas Koenig
1 Sep 24  i    i i i i    i`* Re: Computer architects leaving Intel...120David Brown
1 Sep 24  i    i i i i    +* Re: Computer architects leaving Intel...3John Dallman
3 Sep 24  i    i i i i    `- Re: Computer architects leaving Intel...1Stefan Monnier
30 Aug 24  i    i i i +- Re: Computer architects leaving Intel...1MitchAlsup1
30 Aug 24  i    i i i +* Re: Computer architects leaving Intel...4Stefan Monnier
30 Aug 24  i    i i i `* Re: Computer architects leaving Intel...2John Dallman
8 Sep 24  i    i i `* Re: Computer architects leaving Intel...175Tim Rentsch
30 Aug 24  i    i `* Re: Computer architects leaving Intel...10MitchAlsup1
31 Aug 24  i    `* Re: Computer architects leaving Intel...11Paul A. Clayton
29 Aug 24  `* Re: Computer architects leaving Intel...6Anton Ertl

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal