Comparision of C Sharp and C performance

S

spinoza1111

spinoza1111wrote:


Many years ago I was a sub-editor (proof reader in reality) and I was
given a book by a well known expert on some form of technology. My editor
asked that I be vigilant in ensuring that no mention was made anywhere
in the front matter of the authors numerous academic qualifications.
This was the author's request.

A few months latter I was asked to sub-edit a book by another author who
had a single academic qualification. My editor asked me to ensure that
this qualification was always appended to the author's name.

Now as a self proclaimed superior being you can draw your own
conclusions as to what relevance this has to your writing.

A little [formal] learning isn't a dangerous thing: it goes a long
way, in fact, and part of the problem is that people like Scripto Boy
think it's useless. I can certainly see why the guy with a small
number of academic chops wanted them mentioned, because he didn't want
to get shit on. But Herb has a large number of academic chops, so I
don't see your point.
 
S

spinoza1111

From the GNU C Compiler documentation:
"Historically, COMPILERS [my emphasis] for many languages, including C+
+ and Fortran, have been implemented as “preprocessors” which emit
another high level language such as C. None of the compilers included
in GCC are implemented this way; they all generate machine code
directly."

If you're
writing a demo or instructional compiler as were Herb and I, the first
edition best emits interpreted code, and for this sacrifice of speed
you get better debugging.

did Schildt's "translator" (to use a neutral term) emit any sort of
code?
The GNU documentation clearly implies that a COMPILER which "generates
machine code directly" is better than one that doesn't.

no it doesn't. It says many compilers emit HLL output (for instance C-
front the first C++ compiler emtted C which could then be compiled to
native code using a traditional C compiler). gcc emits native code it
doesn't say (or imply) one is "better" than the other.
But it also
uses "compiler" to refer to what Herb wrote.

I don't think it does.
Gee, you could.

point being?

I'm playing around with a scheme (Lisp) compiler that emits C which
can then be compiled with a C compiler. I'm happy to call that a
compiler. I got the impression Schildt's translator almost directly
executed the source code.

That would if true mean that each time a statement was executed it
would have to be scanned and parsed, and I don't believe that's what
Little C does. Therefore, it's a small compiler.
 
S

spinoza1111

the amusing thing is you name-drop Chomsky then apparently get it
wrong. It probably would have taken you 60s tops to check it out.


once you start using technical vocabulary you enter the realm of
exactness.

Not exactly. In fact, if two development groups use different terms
for the same thing, their insistence on exactness creates confusion.
so you were self taught on this stuff?

No, I read Hopcroft/Ullman in 1971 and took a class in automata theory
in 1979.
If you'd said that at the beginning it would have been impressive.

I said it now.
doesn't auto-didact mean "self taught"?
Yes.

riight...

Leibniz and Newton on the calculus...
 
K

Kenny McCormack

spinoza1111 said:
A little [formal] learning isn't a dangerous thing: it goes a long
way, in fact, and part of the problem is that people like Scripto Boy
think it's useless. I can certainly see why the guy with a small
number of academic chops wanted them mentioned, because he didn't want
to get shit on. But Herb has a large number of academic chops, so I
don't see your point.

You are right, in that this disdain for academic qualifications, is part
and parcel of the dogma of this (and other) newsgroup(s).

I speak from experience, in 2 senses:
1) Because there is *some* merit to it.
2) Because I've often been there myself.

Again, I point this out to indicate that I really do understand where
the regs are coming from, having been there myself. But, again
echoing St. Paul, we must grow up at some point.
 
B

Ben Bacarisse

Which missed the point, since the point was to burn cycles in such a
way that would have brought an interpreter to its knees.

Which misses my point. I was correcting someone else's
misunderstanding about the differences between two pieces of C code.
I was not commenting on why you wrote what you did. Not everything in
a thread you start is about you.
 
R

Richard Tobin

spinoza1111 said:
Of course, insofar as Java
run times translate bytecodes to native machine codes

Some do, some don't, and it depends on the processor too. Depending
on when that edition was written, it might be that all Java VMs still
only had bytecode interpreters.

-- Richard
 
S

Seebs

Sorry to interrupt. I am just curious in why the second implementation
is significantly faster than the first implementation.

I've re-quoted the part where I explained this.
My guess is
that the second implementation breaks the two factorial calculation
into two subroutines, hence the memory can be released after each
calculation which boosts up the speed. Is my guess reasonable?

No. In fact, memory management of any sort would cost time.

The problem was that in Spinny's code, each of the recursive calls
used to calculate factorial(19) would also perform an iterative calculation
of factorial(N) for N <= 19. So instead of calculating factorial(19)
iteratively and being done with iteration, it also calculates factorial(18)
iteratively, factorial(17) iteratively, factorial(16) iteratively, and so
on.

-s
 
S

Seebs

doesn't auto-didact mean "self taught"?

I think he is contrasting himself to the *typical* auto-didact (emphasis
mine).

That said, I have a hard time describing any of his states as "awareness".

-s
 
N

Nick

Nick Keighley said:
Spinoza uses an "unusal" definition of "clear". Attempts to refute him
by quoting dictionaries result in you being told you are using an
incorrect dictionary.

Humpty-dumptyism run wild.

And it lead to me kill-filing him weeks ago. I've just come back from a
hard day's work and so far have read *nothing* in this group but
responses to Spindizzie. Please, guys, give it a rest - he's
unimprovable.
 
S

Seebs

This is a peculiar doctrine. On any usual understanding it is certainly
possible to be both clear and wrong.

We've been over this before. Spinny lied a whole lot in the process,
but the basic executive summary is that there exists at least one sense
of "clear" which implies "leading to knowledge", and at least one sense
of "knowledge" which is "justified true belief". Spinny simply ignores
all the other senses of the word "clear". He also commits a category
error; he can't distinguish between justified true belief about a message,
and the message's content being a justified true belief about reality.

In short, given the phrase "pink elephants", he can't comprehend that it
can be clear that this denotes pachyderms in a pale red, without it being
true that such things exist. Even if we grant his cherry-picked definition,
it is obvious to everyone else that the "justified true belief" would be
about the semantic content of a given piece of writing, not necessarily
implying that the semantic content of the piece of writing describes the
world.

But he'll doubtless be glad to explain all of this to you; if you play
your cards right, you should be able to quote the exact dictionary he claims
to be quoting and get him to tell you it's crap and only the dictionary he
named is any good.

-s
 
M

Mark

spinoza1111 said:
No, just literacy. Had I been Scripto Seebie, I would have called
Herb's "clarity" an "apparent" clarity, since to be "clear" is to have
a clear relationship with the truth. The main definition in the
Compact Oxford English Dictionary defines "clear" as "understandable",
and "understanding" as knowledge of the "truth".

The full (online) edition of the OED seems to be significantly different
to the Compact OED, then.

If you look up "understandable", you find "truth" isn't mentioned, and
the main definitions are:

1. That can be understood; intelligible.
2. Able to understand; capable of understanding.

If you insist on looking at "understanding", the only mention of "truth"
is in quotes like this from Shelley:

"Love is like understanding, that grows bright, Gazing on many truths."

Some applicable definitions include:

1. a. (Without article.) Power or ability to understand; intellect,
intelligence.
1. b. of understanding, intelligent, capable of judging with
knowledge. Similarly of some, of no, understanding.
4. b. Comprehension of something.

There is nothing in the definitions to suggest that clear statements are
in any way connected to truth.
 
S

Seebs

The full (online) edition of the OED seems to be significantly different
to the Compact OED, then.

I *told* you he'd make stuff up.
There is nothing in the definitions to suggest that clear statements are
in any way connected to truth.

And while you could make a case for understanding implying truth... He
still hasn't addressed the obvious category error. Understanding of a
statement implies a true belief about the meaning of the statement, not
that the statement itself is true.

-s
 
R

Richard Bos

Moi said:
Also, beware of rand(). It is guaranteed to deliver only 15 bits of random.

Not even that.

Imprimis, it is guaranteed to deliver exactly zero, zilch, none
whatsoever bits of truly random.

Secundis, and more importantly, it is indeed only guaranteed to deliver
15 bits of _pseudo_-random number, but there is nothing in the Standard
that requires that all 15 of those bits really are pseudo-random. For
example, as question 13.16 of the c.l.c FAQ says: "the low-order bits of
many random number generators are distressingly *non*-random" - an
example given two questions later being that in some particularly poor
ones, the PRNs alternate between odd and even.

Richard
 
B

Beej Jorgensen

Secundis, and more importantly, it is indeed only guaranteed to deliver
15 bits of _pseudo_-random number, but there is nothing in the Standard
that requires that all 15 of those bits really are pseudo-random.

Beej's compliant PRNG implementation?

int rand(void)
{
return 3490;
}

-Beej
 
S

spinoza1111

Don't be daft.

Richard

http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/G_002b_002b-and-GCC.html#G_002b_002b-and-GCC

The language-independent component of GCC includes the majority of the
optimizers, as well as the “back ends” that generate machine code for
various processors.

The part of a compiler that is specific to a particular language is
called the “front end”. In addition to the front ends that are
integrated components of GCC, there are several other front ends that
are maintained separately. These support languages such as Pascal,
Mercury, and COBOL. To use these, they must be built together with GCC
proper.

Most of the compilers for languages other than C have their own names.
The C++ compiler is G++, the Ada compiler is GNAT, and so on. When we
talk about compiling one of those languages, we might refer to that
compiler by its own name, or as GCC. Either is correct.

Historically, compilers for many languages, including C++ and Fortran,
have been implemented as “preprocessors” which emit another high level
language such as C. None of the compilers included in GCC are
implemented this way; they all generate machine code directly. This
sort of preprocessor should not be confused with the C preprocessor,
which is an integral feature of the C, C++, Objective-C and Objective-C
++ languages.
 
S

spinoza1111

I *told* you he'd make stuff up.


And while you could make a case for understanding implying truth... He
still hasn't addressed the obvious category error.  Understanding of a

No, understanding is knowledge and knowledge is justified true belief.
statement implies a true belief about the meaning of the statement, not

You need to read Habermas, although with ADHD it is unlikely that you
will. In "instrumental" communication, people pragmatically
"understand" when they base self-interested actions on what people
say. In communicative reason they "understand" when they directly
acquire justified true belief when in an ethical choice they decide to
trust what a person says in a dialog until given good reason for lack
of trust.

Futhermore, we have shown that you didn't understand the use of the
"stack" in Schildt, since you didn't realize that he was teaching by
example.
 
S

spinoza1111

We've been over this before.  Spinny lied a whole lot in the process,
but the basic executive summary is that there exists at least one sense
of "clear" which implies "leading to knowledge", and at least one sense
of "knowledge" which is "justified true belief".  Spinny simply ignores
all the other senses of the word "clear".  He also commits a category
error; he can't distinguish between justified true belief about a message,
and the message's content being a justified true belief about reality.

In short, given the phrase "pink elephants", he can't comprehend that it
can be clear that this denotes pachyderms in a pale red, without it being

Had you majored in philosophy, you'd have learned that most non-Anglo-
American philosophers find these examples jejune.
 
S

spinoza1111

And it lead to me kill-filing him weeks ago.  I've just come back from a
hard day's work and so far have read *nothing* in this group but
responses to Spindizzie.  Please, guys, give it a rest - he's
unimprovable.

That says something about the group, doesn't it.
 

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
474,102
Messages
2,570,645
Members
47,245
Latest member
ShannonEat

Latest Threads

Top