Re: The annotated annotated annotated C standard



spinoza1111 said:

On Jan 20, 3:16 pm, Richard Heathfield <r...@xxxxxxxxxxxxxxx> wrote:
spinoza1111 said:

<snip>

In fact, a runtime error produced by a bounds checker is preferable to
"undefined behavior", as is INF or a similar symbol.

Whether this is preferable depends very much on the situation. What
Stephen didn't mention is that there are times when a programmer needs
to step outside the Standard in order to achieve a platform-specific
goal. When we do this, it very often involves constructs that the
Standard declines to define. For example, we might need to point to a
particular hardware address that we know exists and is writeable on our
particular platform.

Why not use assembler language and thereby avoid even the hint that
the code might "port".

Because there's no point, and there are (at least) two reasons for that.
Firstly, C is quicker to write than assembly language. It's a good
trade-off between expressive power and speed. Secondly, a wise C
programmer isolates non-portable parts of the code into their own module,
and rewrites *only* the non-portable parts for each new platform. If this
is done well, it can result in something like 99% portability (i.e. around
1% of the code needing to be rewritten for each port) even on such
inherently platform-specific applications as Web browsers.

<nonsense snipped>

Programming low level in a high level language is, I now believe, a
species of intellectual fraud.

Yes, but you believe all kinds of junk, so why should we take your latest
junk seriously? For example, you apparently believe (or have recently
believed) that I work for MI5 and possess a time machine. If we all went
around believing everything you believe, we'd all be insane by now.

Doug Gwyn once said that "UNIX was not designed to stop you from doing
stupid things, because that would also stop you from doing clever
things."

I am underwhelmed by programming cleverness,

I believe this...

having been clever myself on occasion,

....but not this.

having programmed a compiler in machine language.

You're obviously very proud of this, because you keep on mentioning it. But
you don't need to be clever to write a broken compiler. Writing a working
compiler is the trick. If you claim to have written a working compiler,
pardon me for laughing.

I'd rather learn more about music and art.

Try alt.music.* or rec.arts.*

Very much the same idea applies to C. Yes, some modern languages are
sand-boxes in which you can't break anything no matter how hard you try,
but this is at the expense of limiting your horizons to things which, at
some level, the language designers envisaged when they decided what to
allow and what to disallow.

"The anarchism of the lower middle class". - E. F. Hobsbawm

Presumably you mean E J Hobsbawm. But of course your response is irrelevant
to my point. This is nothing to do with anarchism and it's certainly
nothing to do with class.


ISO C doesn't impose such limits. It draws a line around the abstract
machine and says, effectively, "in here, we can make some promises about
program behaviour - but if you step across the line, you're out of the
box and you're on your own".

In fact, mathematics itself progressed because mathematicians weren't
intimidated by thugs on standards committees, whence complex numbers.

Because mathematicians frequently ignored rigour, mathematics found
itself in a deep hole in (I believe) the mid-19th century, because while
one mathematician was proudly publishing a proof of some theorem or
other, some other mathematician was equally proudly publishing a
disproof - and no flaw could be found in either paper. Goedel hadn't
done his thing yet, and mathematics was still believed to be consistent
and complete. So mathematicians were forced to the conclusion that some
of the stuff they were relying on had not properly been proved, and they
had to re-examine *everything* from the ground up, to put mathematics on
a (relatively) sound axiomatic and theoretical footing. This took a lot
of people a lot of time. Nowadays, rigour is de rigeur for formal
mathematics. And so it is for competent programmers.

The problem with this metaphor was that the "rigor" of Lord Russell's
Principia Mathematica turned out to be a complete dead end and a
complete waste of ink,

The problem with your response is that my statement isn't a metaphor.
Mathematicians really did have to put their discipline on a rigorous
footing. And so do intelligent programmers.

perhaps as will the C standard.

The C89 Standard was proving its worth even before it was finalised, with
vendors rushing to update their compilers to incorporate the very latest
changes. Programmers were *demanding* standardisation, and vendors were
anxious to provide it. And now we have it, and it's every bit as useful
now as it was then.

<snip>

Wolfram contradicts himself: you can't, but you can.

Actually, no, he doesn't. I suggest you read it again more carefully.


Basic with the structured programming additions happens to be superior
to C. It evaluates the for limit once and doesn't allow stupid
cleverness.

If what you say about BASIC's for loop is correct (and I am not about to
take your word for it), this makes BASIC's for loop less flexible than
that of C. Full evaluation of the termination condition each time
through the loop is a powerful construct if used properly.

It already exists, and it's called the while statement.

So you actually have to choose which loop control you want, depending on
whether you want the termination condition to be re-evaluated each time
round the loop? You actually have to remember that? Well, okay.... if
that's what you want, I guess that's fine - for you.

People need a minatory "rigor" only when infected all the way down by
the lack of committment to truth

That's exactly why you need a minatory rigour.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
.



Relevant Pages

  • Re: Dumbing down?
    ... I think engineering training is more important. ... programmers found gainful employment during the dot-bomb era when ... they come from abstract mathematics world. ... How does the fact that you wrote a formally verified driver for X ...
    (comp.lang.lisp)
  • Re: [opensuse] Re: [SLE] Novell-Microsoft: What They Arent Telling You
    ... Today there are quite literally thousands of "programmers" that do not ... These folks are *not* being educated in mathematics as a theoretical ... (e.g. for Java: use interfaces a lot; composition over inheritance; high ... skills of new-hires coming into the department. ...
    (SuSE)
  • Re: languages for CAS .. was: Re: Which is the best CAS
    ... if one wants to get the exponent and the normalized ... (incf sumsq (* r r)) ... Some computer programmers have a great deal of trouble with mathematics. ...
    (sci.math.symbolic)
  • Re: Looking for a cartoon
    ... "If you don't know math, ... posting those comments were professional programmers; ... learned mathematics considers the investment productive. ... The student contracts to set aside his infantile ...
    (sci.math)
  • Re: What is a proof, exactly?
    ... Because that's what proving things is all about. ... proof - I'm trying to get to know what that standard looks like. ... there is a formal proof, being a sequence of statements following from ... be possible to actually have a foundation for mathematics based purely on ...
    (sci.math)