subroutine stack and C machine model

S

spinoza1111

_C: The Complete Reference_, 3rd edition, page 56:

        Order of Evaluation

        The ANSI C standard does not specify the order in which the
        subexpressions of an expression are evaluated.  This leaves the C
        compiler free to rearrange an expression to produce more optimal code.
        However, it also means that your code should never rely upon the order
        in which subexpressions are evaluated.  For example, the expression

                x = f1() + f2();

        does not ensure that f1() will be called before f2().

"I have never taken ANY computer science classes" - Peter Seebach

The standard was motivated, I believe, officially by the need to
recognize the large number of optimizing C compilers which indeed
reordered operations. Unofficially I think it had a mandate not to
make ANY powerful vendor make changes to a compiler without a business
case.

As it happened, a lot of C programmers, then and now, would hand
optimize by assuming something true in nearly all cases: left to right
evaluation. Using the comma operator allowed them to add side effects
as appropriate to left hand sides, simulating the opportunities one
has for hand optimization in assembler code.

Other, less well-qualified C programmers disliked these practices
while at times engaging in them either unwittingly or out of that form
of personal vanity which justifies what "I" do while condemning it in
others.

To preserve working code the Standard could and should have asserted
that "left to right evaluation applies to the normal cases where it is
expected to apply: however, optimizers may transform unoptimized code
using mathematical rules: for example, a+b may be compiled as a
commutative op as b+a: but unoptimized translation must always be
available".

***** But because members, apparently, were selected not because of
their qualifications, with one member never having taken a computer
science class, but because of a willingness to destroy people in
defense of corporate profits *****, this was not done.
-s
p.s.:  My copy has a note in the margin next to this saying "very good!"

Wow, you even got to grade yourself. Sweet.

"I have never taken ANY computer science classes" - Peter Seebach
 
S

spinoza1111

In

spinoza1111wrote:




An implementation is free to reorder things if necessary, provided
that this makes no semantic difference to a strictly conforming
program.

Richard, you write well what we know. Thank you. But you have to run
before you walk, and those of us who have (unlike Seebach) taken
computer science classes (har har har) and those of us who have taught
them know that the optimized case can never be presented before the
unoptimized case.
Thus, given this code:

  int foo(void)
  {
    printf("Hello ");
    return 6;
  }

  int bar(void)
  {
    printf("world");
    return 42;
  }

  int baz(void)
  {
    int x = foo() + bar();
    return x;
  }

the compiler is free to assign 48 to x before printing "Hello world".

This neglects the fact that the tyro, at the level of reading Schildt,
needs to keep the Optimization switch in the OFF position at all
times. It doesn't mean anything is undefined.
unless a strictly conforming program can't tell the difference.


Register, parameter block, maybe even a stack. It's up to the
implementation.

We tried using fixed registers in IBM 1401 and 360 assembler language
and they worked, as I have said, UNTIL any procedure was called by
another of its own invocations directly or indirectly. The caller
would provide space in its own region of storage to save all 15 IBM
360 registers or a subset of the registers in use.

Likewise the first Fortran compiler used a "Monte Carlo simulation
technique" on the IBM 704 to allocate a small number (3) of registers
to Fortran expressions. It could do this because it was an "error" in
Fortran to call yourself directly or indirectly.

But then it was found, first in compiler development and later
elsewhere (even in financial applications including reinsurance) that
procedures needed to recurse.

I suppose that a prof in a real cs class could elect to present a
fixed register model and ignore stacks: I have myself said you must
run before you walk.

But note that he would then be open to precisely the same sort of
charge Seebach makes against Schildt: of "lying", of obscuring the
grand and glorious Truth which people can access (even if the have
never taken a computer science class) as long as they sit behind a
terminal trashing other peoples' good name while never questioning
Corporate directions.

The stack, like the Turing machine, basically explains a lot while
postponing the less important issue of blinding speed, something
adolescents have to grow out of. Polish Notation, while completely
anti-"pipelining", while constraining execution to a single thread,
showed how the infix notation of Principia Mathematica could be
interpreted not only by Bertie Russell but also by a machine, even in
Poland.

It democratized mathematics, but ever since the sort of people who
have never taken a computer science class but like to trash other
people have been trying though obfuscation to reverse this.
 
S

spinoza1111

In <[email protected]>,

spinoza1111wrote:



Just out of sheer curiosity, could you please name such a compiler?


If you move what we used to call "badly-behaved" code to any other
compiler, it runs the risk of breaking. ("Badly-behaved" doesn't
imply "bad", by the way. In the days of slow computers, it was very
often the case that taking advantage of the quirks of a particular
platform was the only way to get stuff done fast enough.)


If the order matters, specify it:

  int v = inner1();
  v += inner2();
  return v;

Thanks for being so clear. I am sure glad I left C after leaving
Princeton, and bought Visual Basic 3. That's because I think it makes
more sense to code

int v = inner1() + inner2();

It's more elegant and terse, and it saves vertical space on my screen
when I use my Vivienne Tam HP Fashion Mini Netbook on the Lamma Island
Ferry, matching my dress and shoes. Ha ha. I mean my plain silver Mini
Netbook, which has a smallish screen size.

More generally, it is better in my view to code expressions as opposed
to step by step code. Part of my motivation may be snobbery: I
wouldn't want to be a sniveling little snot nosed coder whimpering at
Hong Kong Shanghai Bank on the Isle of Dogs, I'd rather be Einstein if
I could.

But seriously, expressions are more solid than code snippets and
easier to judge...unless you're using a compiler "standardized" by
people who have never taken a computer science class, of course.
 
S

spinoza1111

@invalid.address.org> writes: [...]

[the discussion has moved the point that in priciple different
computations can be executed in parallel]

I'm not sure if a compliant C implementation could do this, but it is
certainly permitted to reorder things. Heavy application of the As If
Rule could presumably allow parallel execution.

Consider
     f (g(), h());

most Pascal implementaions would execute the functions in the order g,
h, f. Most C (or older ones anyway) would execute them in the order h,
g,f (it makes varargs functions eaier to implement).

OK, I didn't know that. I believe the Microsoft compiler I used circa
1991 went left to right but I may have assumed this because of my well-
known tendency to, like a sensible, intelligent person, confuse comma-
as-op with comma-as-parm-sep.

But: in this era, guys like Schildt could KNOW, after making an
experiment and/or examining the compiler output, the order. In the
absence of a standard they were in fact justified at generalizing this
knowledge.

But as we know this killed portability since in fact other compilers
went left to right.

But note that the grand and glorious standard didn't help because like
Rabbi Levine, it said, "you're both right". It did so not through
tolerance but in order to avoid having to discommode vendors.
How is it possible that the "two function calls" "could" be executed
in parallel? C99 standard 6.5.17: "The left operand of a comma
operator

there is no comma operator in the above code. The comma seperating the
arguments in a function call is not a comma operator. C overloads it's
lexemes with various semantics.
Yes.
is evaluated as a void expression: there is a sequence point
after its evaluation. THEN [emphasis mine] the right operand is
evaluated...".
Yes, the expression "fa(a+1), fa(a-1)" could be evaluated in a non-
stack environment. There are probably ** very few ** code snippets
that could not be compiled to a machine with fixed registers.

But nobody, in all probability, has learnt to code C by reading a
standards manual,

I learn computer languages partly by reading the manual and partly by
writing code. I did indeed use the language standard as part of my
learning material when learning C. The C Standard is a surprisingly
readable document.

This is the worst way to learn, and your behavior and that of Seebach
shows why, since the guy who sits in the corner with a Standard and a
workstation is usually the guy nobody else can stand. Sure, I am here
that guy, but that's because this joint is a sort of club for lost
souls who nobody else can stand whereas I'm a class act who everyone
likes in meatspace ha ha ha.

Yes, using manuals is good. Reading the standard is great. But not as
an introduction, for most people.
cobblers. I haven't read the C99 Standard in detail but I don't
believe it differs vastly from the C89 one and that was quite
readable.


I don't see this,could you explain?

No, I cannot in any reasonable amount of time. You need to take a
course in computability and formal languages.
 
S

spinoza1111

Spinny used "faggots" as an insult in a thread in another forum.  From
context, it means "people who understand algorithms better than I do".

Yes I did, you faggots. You see, when you set out to ruin people, you
do it in only one "key", a girlish, prissy, self-righteous and nasty
way which denies what it is doing and systematically fails to
understand what it might mean for a person's family to see their name
made into a crude ephitet, merely because one of their number has
published a book.

Whereas I am capable of different "keys", you faggots, such as irony
and hyperbole.

Seebach, who has never taken a computer science class, has tried for
the past ten years to destroy the good name of a person who never, to
my knowledge, did him any wrong, and not once did Seebach call Schildt
a "******".

It's not a matter of words. It's a matter of meaning and behavior, you
faggots.
 
S

spinoza1111

We don't, but it has no place here, and in any case your attempts at
"philosophy" are mere gabbling.

Y'know, you were born in the wrong era. In earlier times, I'm sure you,
with your minor versifying and other babblings, could have found
employment as the Fool in the court of some third-rate German princeling.

Perhaps. You know, Shakespeare's Fool is the smartest guy in the room
in the second act of Lear. In a state of universal evil, where people
without computer science training can use the Internet to destroy
reputations, the Fool, and later the feigned madness of Tom o' Bedlam,
is truth to power.
 
S

spinoza1111

Ahh, boring.


What's funny to me is the huge overlap between this guy's crazy rants and
those of another guy I had similar arguments with a while back.  They're
clearly different people, but they have the same madnesses.

Hmm, interesting perception. It's common in little programming
"shops". "Gee, he sounds like that guy who worked here a while back".

But on investigation, we usually find that "that guy", or "this guy",
whether in the "shop" or on the Internet, are actually quite
different. The lunatic sameness is in the sort of people who sit in
little offices and brag about never having taken a computer science
class and conduct whispering campaigns of personal destruction.

Guy comes in with a little humanity, like this guy at Baxter who was
considerate of others at the end of the mainframe batch era, and would
carefully separate other people's printouts when, at the end of the
1970s, it was becoming the fashion for "highly competitive"
programmers at Rockwell-Wescom to throw their coworkers printouts
away. Guys like you then do your best to ruin his good name, don't
you?

But then you always remember him, sort of as the Last Man to visit
your Cave of the Troglodytes.

Don't you.
 
S

Seebs

I gave you the opportunity to support your claim, and you ignored it.
I give you a further such opportunity - could you please name an
old-fashioned C compiler that evaluated left to right? Just one is
all I'm asking - that shouldn't be hard, should it, if they were so
dominant?

Now you have me wondering whether I can find my old Amiga compilers.
I had two, and there was enough code that worked with only one or the
other that I wouldn't be shocked if, at least at low optimization levels,
one of them had a predictable ordering.
In my view, correctness trumps elegance, terseness, and vertical space
economy.
Agreed.

Incidentally, I never found out whether VB3 guaranteed a particular
evaluation order, despite using it on several large projects. It
never mattered, though, because I didn't need or want such a
guarantee. If the order mattered, I specified it myself.

That is, of course, why it is that I can't tell you whether any of the
compilers I've ever used have had a left-to-right evaluation mode. Once
I realized that a program calling printf() did not necessarily yield
generated code which invoked or linked with printf(), I got a lot less
interested in trying to guess what specific order of evaluation compilers
would use...

-s
 
S

spinoza1111

In

spinoza1111wrote:

I gave you the opportunity to support your claim, and you ignored it.
I give you a further such opportunity - could you please name an
old-fashioned C compiler that evaluated left to right? Just one is
all I'm asking - that shouldn't be hard, should it, if they were so
dominant?

Not really germane, another poster has pointed out that it may very
well have been right to left. The point was that it was consistent and
most C programmers would experiment to find out what it was. The point
was that the C99 standard should have decided on an order because
existing code assumed an order.
In my view, correctness trumps elegance, terseness, and vertical space
economy.

True. Which is why I don't use C!
Incidentally, I never found out whether VB3 guaranteed a particular
evaluation order, despite using it on several large projects. It
never mattered, though, because I didn't need or want such a
guarantee. If the order mattered, I specified it myself.

You never bothered. I believe it was left to right. It was consistent.
 
S

spinoza1111

You ain't seen nothing yet. According to him, I work for MI5, my role
being to suppress free expression in comp.programming. (Presumably
any suppression I get up to in comp.lang.c is my own affair as long
as I do it on my free time.) Also according to him, I started the
whole Schildt-doesn't-know-C "campaign" because I viewed him as a
competitor to "C Unleashed" (despite the fact that concerns about
Schildt were being expressed by others, in rather strident terms,
almost a decade before I started using Usenet, and despite the fact
that my own expression of such concerns pre-dates the Sams request).

Oh yes, and he thinks I'm anti-Semitic and that we're all Fascists and
Nazis, and if you mention Godwin he starts trying to deconstruct
that, too.

No, I think you are nasty little clerks who don't know your jobs but
use innuendo and the politics of personal destruction. For example,
Peter Seebach hasn't taken any computer science classes whatsoever yet
has tried to destroy the reputation of someone who has.

In history we discover that the precedent is in fact the German white-
collar class which was ruined by the Weimar superinflation of the
1920s and as a result was emotionally manipulated by Ernst Rohm and
Hitler to believe that their problems were caused by specific named
people and ethnic groups. They also would make fun of a person's name:
they also were academically unqualified to pronounce on the work of
Husserl or Einstein: they also trashed the reputations of any person
who tried to defend their targets.

It wouldn't surprise me, given that Heathfield's Britain and Seebach's
USA is in the worst Depression since the 1930s, that Heathfield and
Seebach are in fact filled with personal resentment based on their
unemployability, or the fact that while they may style themselves as
consultants they are in fact begging hand to mouth for work from a
diminishing set of temporary employers.

Nor would it surprise me if their politics aren't drifting to the
right. Heathfield may like Nick Griffin, the British National Party
leader, because of competition from Islamic programmers who don't use
C. And we find on Seebach's own paper trail that he liked Bush in
2000.

It is true that I was wrong when I five years ago thought you the
originator to the Hate Schildt campaign. It was Seebach and his friend
Clive Feather. But part of the problem was the mob action that ensued
and you were part of this.

And, as I've said, I do not know in fact whether you work for MI-5. I
can only speculate that your Secret Lair is under Brize Norton RAFB,
an enormous warehouse fulla guys driving fork lift trucks around with
you at the central console with Mini-Me and your son, Scott
Heathfield, calling you a dork. But I do know that you're always here
no matter what time it is in the UK and its lost colony of Hong Kong,
and I find this disturbing. Get a life.
Possible, but unlikely. He even claims to have written a book about
compiling. I haven't read it myself, so I don't know whether the
claim is true. But one thing I have learned about him is never to
trust anything he says for which I can't get independent
confirmation. I am reasonably certain he has written a book. I am
reasonably certain it has the phrase "write your own compiler" in the
title. I am not even remotely certain that it's about compilation,
however.

Had you been interested in checking this out, you would have verified
it. Indeed, you probably have. But you prefer to continue to
libelously spread rumors which will eventually find you on the dock in
your legal system, my dear fellow.

This is the link to my book.

http://www.amazon.com/Build-Your-NE...=sr_1_1?ie=UTF8&s=books&qid=1256539440&sr=8-1
 
C

Chris McDonald

spinoza1111 said:
This is the link to my book.

Have you considered suing the authors of those less-than-flattering
reviews? I suspect that some of them were made by people who have not
attended a single CS lecture.

It must be so demoralizing for you, and you family, to have been attacked
and insulted in public like that. How could anyone describe your efforts
as "...a lazy and deceitful attempt and the author should be ashamed for
not taking the time to do it properly..." and "...so full of technical
errors..." and get away with it?

If only you had some pathological sociologist to prattle away for over
a decade in your defence!
 
S

spinoza1111

Have you considered suing the authors of those less-than-flattering
reviews?  I suspect that some of them were made by people who have not
attended a single CS lecture.

No, I haven't, because it's one thing to post a review, another thing
to enable a cybernetic mob like the one that sent death threats to
Kathy Sierra. The person who started the "mean kids" attack on Sierra
withdrew his complaints. Seebach needs to do the same thing, because
without CS training he has no standing. Nonetheless people believes he
has authority, and he needs to clear this up by admitting that in
elementary computer science, generalizations have to be made about
"stacks" which are then falsified, in part, by more advanced material
on optimization and in parallelism, even as students in physics learn
Newton before Einstein. Stack semantics is like Newton: it works at
lower speeds and in familiar environments. Optimization is more like
Einstein. You don't do it until you understand how a simple stack can
run C.

There was a "mean kids" flavor to some of the reviews of my book but
it never got to the point of Schildt. Other posters at Amazon, clearly
more qualified, praised the book and its software.
 
S

spinoza1111

In <[email protected]>,





spinoza1111wrote:


Do you mean you retract all of the above insane allegations?


I accept that you think that, but of course your thinking is flawed.


He knows his stuff. You don't. He hasn't destroyed your reputation.
You have.

How do you know he knows his "stuff"? You also seem unaware of the
need in computer science for intutionist mathematics as opposed to
Platonist, and of the need to explain independent of time and space
constraints or "efficiency".
Whilst I have no particular antipathy for the man himself, his
political philosophy is not only evil but also off-topic.

I think it's on-topic because you think and speak like him and under
stress you'll probably vote for him. Cameron's too posh for your lot,
isn't he?
Two admissions in 24 hours. You're improving. (I actually mean that.
It is a sign that you are feeling your way towards a more mature way
of discussing. But you have a long way to go.)

Bite my crank.
No, it really wasn't. Keep going.


It isn't a problem, and there was no mob action.



No, that would involve reading it, which would involve buying it,
which would involve funding ignorance.

No, it would have involved just visiting a Web site to confirm the
existence of the book. This is actionable, boyo. You are knowingly and
maliciously spreading a rumor, that I did not write the book, when you
can verify that I have.
 
S

spinoza1111

In

spinoza1111wrote:





It's astounding, isn't it? You obviously agree, since you cite the
same quotation twice. I don't remember the quote and I don't know the
context, but (remembering that I don't trust you to tell the truth) I
will take the above at face value for now.

Let's look at the implication. Here's Seebs, who has never taken a CS
class in his life, running technical rings round you despite all your
alleged college education. He knows more about the Standard than you,

The Standard is the problem and the less said about it the better.
Knowing it is not good. You admit it failed.
he knows more about C than you, and in fact he knows more about
programming in general than you. You have yet to score one technical
point over him, and he has scored many over you. In fact, in that
regard he reminds me of me.

You say this for the same reason corporate types say it. "Knowing" in
most financial software corporations means "talking with confidence,
and proving your chops by bullying safe targets".

In fact, Seebach gives no evidence for knowing programming. Had he
known programming, he would not have participated in a "standard" that
declares that things cannot be known or predicted. He would have known
that we need programming languages that allow us to sensibly predict
what code will do.
Seebs's technical knowledge is not only formidable but also very easy
to identify, and anyone who seeks to mock it is on a hiding to
nothing.

This isn't at all evident. In my experience in taking computer science
as an undergraduate and graduate student, computer science professors
in computer architecture, and textbooks, will confirm that stacks and
twos-complement are in ordinary use. Schildt confirms both facts, but
Seebach denies them because he learned computer science apparently
from hacking and reading the Standard.

Seebach doesn't give any evidence for knowng WHY twos-complement is
the default choice, that being the fact that we don't want to have two
different zeroes.

It's as if I'd reasoned in 1970 from the local properties of the IBM
1401 (variable-length operands, no general registers) to the
properties of all computers. But reading Sherman's "Programming and
Coding for Digital Computers" I realized that most large computers
used in fact a radically different architecture with fixed word
lengths and registers. But reading Turing, I realized that either
computer could simulate the other given enough time and memory space.

Whereas Seebach has read a grand total of one book, and resembles the
lawyer in Dickens' Bleak House, who prides himself on reading only
case materials in Jarndyce v Jarndyce.

Whereas Seebach believes it to be intelligent to say what C "is not"
because that way you have through the logic of negation a higher
chance of being right, which is what you need when you're basically
bullshitting yourself and others...by randomly attacking Schildt
because you can't get laid (or something).

A Bush supporter, Seebach uses Bush's logic, of making a statement not
easily proved nor easily disproved. Bush said that Saddam Husayn might
have WMD and thousands of servicemen and women died, and, we found
that Saddam Husayn had no WMD. Seebach implies that Schildt is
unqualified because the C standard allows for exceptions to the use of
twos complement and the stack; but Seebach, like Colin Powell in the
UN in 2003, Seebach is unable to coherently identify or name the
exceptions, only to insist on their logical possibility. And when
challenged to do so, Seebach, like Bush, ruins careers and names, even
as Bush saw to it that Valerie Plame, a CIA agent, was outed in
violation of the law when her husband, a former US ambassador,
published facts disproving the "Nigerien yellowcake" justification for
belief in Saddam Husayn's nonexistent nuclear program.

Let's look at this example of Seebach's incompetence and dishonesty.

Herb: free() must only be called with a pointer that was previously
allocated with one of the dynamic allocation system's functions
(either malloc(), realloc(), or calloc()).

Petey: Also specifically untrue. ANSI states that free(NULL) is valid
and has no effect. (Also note that it must be called with a pointer to
space previously allocated, not with a pointer previously allocated,
and that the pointer must not have been already freed or passed to
realloc().)

Herb is imparting a valuable lesson, fundamental to programming: when
you open something, close it, for every right parenthesis there is a
left...like debits and credits in accounting. As a practical matter,
Schildt is saying that if you have a memory bug, check the balancing
of malloc/realloc/calloc versus free. Competent C programmers do this
all the time.

Little Petey's counterexample? Drum roll: free(NULL). As if little
Petey never heard of the special role of the number zero in ordinary
arithmetic, or of the zero element in an abstract group.

Peteywunkle, we KNOW that NULL is different. In fact, do you know that
if it is returned by malloc this is a failure indication that needs to
be tested?

Your words after that are also things we know, written very poorly.

Seebach is worse than my student Otto who with his personal problems
constantly interrupted my C class in Chicago providing insights based
on 20 years of assembler. Seebach is more like the Nazi bullies who
would interrupt classes in the Weimar Republic.
 
N

Nick Keighley

it's a really good way to teach C as it's actually true. I once wanted
to call a function like this
f (a, a + 1, a + 2);

but I coded it
f (a, ++a, ++a);

the compiler wasn't as mean to me as it could have been (those ++
operators result in undefined bahaviour) but it actually evaluated the
arguments right to left rather than left to right. So *don't* assume
arguments are evaluated in any particular order.

"I have never taken ANY computer science classes" - Peter Seebach

nor have many of the highly competant programmers I have encountered
over the years. You are a snob.

As it happened, a lot of C programmers, then and now, would hand
optimize by assuming something true in nearly all cases: left to right
evaluation.

they'd have some nasty surprises on most C compilers then. I general
this doesn't seem a very useful way to optimise. It is most likely a
micro-optimisation

"the root of all evil is premature optimisation"

Using the comma operator allowed them to add side effects
as appropriate to left hand sides, simulating the opportunities one
has for hand optimization in assembler code.

you've actually *seen* someone do this?

Other, less well-qualified C programmers disliked these practices

....because they didn't work
while at times engaging in them either unwittingly or out of that form
of personal vanity which justifies what "I" do while condemning it in
others.

<snip>
 
N

Nick Keighley

The Standard is the problem and the less said about it the better.
Knowing it is not good. You admit it failed.

This is an extra-ordinary statement. Richard Heathfield "admtted that
the standard failed"? Do you have a cite? I'd have described that C
standard as being most extra-ordinarily success story over decades of
heavy use. C runs on an astounding variety of platforms. C is the
backend to a vast array of our modern world. And the Standard has a
large part to play in this. What on earth would you characterise as
*sucessful*?!

Oh, yes I know C99 didn't catch on as well as it might. But this just
reflects, again, what a fantastic job the ANSI C89 did.


In fact, Seebach gives no evidence for knowing programming. Had he
known programming, he would not have participated in a "standard" that
declares that things cannot be known or predicted. He would have known
that we need programming languages that allow us to sensibly predict
what code will do.

most programming languages have such "holes". Giving optimisers the
freedom to re-arrange expressions is useful.


<snip>
 
N

Nick Keighley

Nick Keighley a écrit :


There are two things to take apart here

(1) Implying that somebody that doesn't take computer science classes
     is a bad programmer is being a snob. This is true.
ok

(2) Implying that lack of theory is a virtue is being a stupid.

I never said that. I think knowledge of theory in many domains and in
particular is highly desirable. I regard "continuous self education"
as - well I as as going to say essential but I'll have to qualify
that.

Theory
     is essential in programming any reasonable large system. Yes, you
     don't need any if you program hello world style programs but for
     more serious undertakings theory is a must.

My experience is that it is *not* essential. I know many highly
competant programmers who have never cracked a computer science text
book in their life. They might not write compilers but they do not
write trivial systems. I might believe they'd be better programmers if
they had a better grasp of the the theory but the fact is that they
manage.
There is an "underground current" in this group against anything that
smells as abstraction or higher level thinking.

I'm not sure there is. And I'm pretty sure I'm not guilty of it, if
there is. Abstraction and high level thinking are very much things I
consider important. I'd also like my program to complete its task
before the sun goes out.
C is for low level programming,

it can be but it can also do a surprising amount of abstraction

any discussions of higher level constructs are shunned
or despised.

what you mean is anyone who doesn't agree with you is an idiot.

People say proudly that they never use data structures
more complicated as arrays,

name three
and software engineering discussions are
killed because they are "off topic", unless (of course) it is heathfield
that starts them, usually in some other thread.

I freely admit to sneaking software engineering issues into clc. I
often get away with it. They happen interest me and "how to use C" is
in my not so humble opinion, completly on-topic.

This general attitude of fanatic conservatism (going back to the
1989 standard, fighting against C99, etc) is paired with an ever
lasting need to go in "nostalgic" mode and lament about old and
obsolete machines/environments. Those discussions are lively followed.

The risk of getting into a "fossil" state increases as you age. This
is just a consequence of the human condition, and must be fought
with the same force as the tendency of destroying things for the
mere fun of getting a "new and improved" model, that is so often
seen in young people.

just because someone disagrees with you doesn't mean they are senile
 
N

Nick Keighley

most programming languages have such "holes". Giving optimisers the
freedom to re-arrange expressions is useful.

From The Revised Report on Algol 68:-

"0.2.4 Collateral elaboration in ALGOL 68
Whereas, in ALGOL 60, statements are executed consecutively, in ALGOL
68, phrases are elaborated serially or collaterally. This latter
facility is conducive to more effcient object programs under many
circumstances, since it allows discretion to the implementer to
choose, in many cases, the order of elaboration of certain constructs
or even, in some cases, whether they are to be elaborated at all. Thus
the user who expects his side effects" to take place in any well
determined manner will receive no support from this Report [...]"


The Revised[5] Report On The Algorithmic Language Scheme

"A procedure call is written by simply enclosing in parentheses
expressions for the procedure to be called and the arguments to be
passed to it. The operator and operand expressions are evaluated (in
an unspecified order) and the resulting procedure is passed the
resulting arguments."


ISO 7185 Pascal Standard

"A function-designator shall specify the activation of the block of
the function-block associated with the function-identifier of the
function-designator and shall yield the value of the result of the
activation upon completion of the algorithm of the activation [...]
The order of evaluation, accessing, and binding of the actual
parameters shall be implementation-dependent."


Ada 95
"For the execution of a subprogram [procedure or function] call, the
name or prefix of the call is evaluated, and each parameter_-
association is evaluated (see 6.4.1). If a default_expression is used,
an implicit parameter_association is
assumed for this rule. These evaluations are done in an arbitrary
order. [..]"


Appendix M of the Ada Standard specifies 136 Implementation Defined
features of the Ada language. Perhaps we should be grateful they never
built "Star Wars"...
 
S

spinoza1111

This is an extra-ordinary statement. Richard Heathfield "admtted that
the standard failed"? Do you have a cite? I'd have described that C
standard as being most extra-ordinarily success story over decades of
heavy use. C runs on an astounding variety of platforms. C is the
backend to a vast array of our modern world. And the Standard has a

....yes, our modern lovely world...
large part to play in this. What on earth would you characterise as
*sucessful*?!

Oh, yes I know C99 didn't catch on as well as it might. But this just
reflects, again, what a fantastic job the ANSI C89 did.



most programming languages have such "holes". Giving optimisers the
freedom to re-arrange expressions is useful.

That freedom does not come from standards committees, especially
committees that admit as "voting members" people who have never taken
a computer science class. It comes from mathematics. It's valid to
rearrange a+b to b+a not by the ukase of a standards committee but
because of the laws of mathematics. Furthermore, if a is not a "term"
but an expression potentially with side effects, the optimization
should be banned by a rational standard. It happens to be possible to
tell the difference between "an expression known not to have side
effects" and "an expression which may have side effects" from syntax
alone even in C, and had a certain "voting member" taken a compiler
development class he would have learned this...and NOT approved all
sorts of code motion, including completely invalid code motion.
 
S

spinoza1111

In <[email protected]>,

spinoza1111wrote:



You obviously think this whole Kathy Sierra thing is important to
comp.lang.c, but it's hard to see why. As far as I can tell, she has
written four books, none of which is about C.


With you, perhaps not. But the C community takes him very seriously,
because he knows what he's talking about.

I don't think he does. It appears to me that he isn't aware that a
compiler can tell, even in C, the difference between an expression
that MAY have side effects from an expression that DOES have side
effects. Nor does he seem to be aware that a program must run
correctly and in a knowable way in a non-optimized environment using
(for example) stacks and twos-complement before we port it to a more
exotic platform. He also seems to believe that free(NULL) proves that
you don't always have to free() things that have been malloc'd,
knowing nothing about the special case that proves the rule in all
other cases.

I think instead that like a cheap thug, he raised himself in your
estimation by his attack on Schildt. He "made his bones" as in the
Mafia.
Hardly surprising, given the relative sales volumes.


And your appraisal of the quality of the reviewers of your own book is
of course completely unbiased, right?

Right.

The belief here is that everybody is in fact biased, which is in
itself a denial of the worth of university education apart from
technical school. But in fact, being objective about one's own
intellectual production is what we learn at university, and it now
appears that with respect to computer science, Peter Seebach hasn't
learned this. As a result, he thought his attack on Schildt a serious
document, whereas it was probably laughed at at McGraw Hill.

You fail to notice that I reviewed my own book, and I gave myself a
"4" because objectively I judged that I had run out of time to do a
more complete job. In particular, I did not feel I covered runtime
enough, I would have preferred to have written the book software in C
Sharp, and I tested the software (as is stated in the book) primarily
to be sure that all code examples ran.

I was in fact unbiased. Many reputable authors actually spam Amazon
with multiple favorable reviews of their own book. At one point I did
so: I added one favorable review from another account. A year later I
posted that I had done so and had the Amazon moderator remove that
despite the fact that an organized assault had been apparently
directed against the book, artificially lowerings its rating and
harming its sales.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,990
Messages
2,570,211
Members
46,799
Latest member
Mercury_Dev

Latest Threads

Top