Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Java versus C Speed Comparison

Author: Miguel A. Ballicora

Date: 09:30:16 01/11/03

Go up one level in this thread


On January 11, 2003 at 11:30:44, Robert Hyatt wrote:

>On January 11, 2003 at 02:10:45, Miguel A. Ballicora wrote:
>
>>On January 10, 2003 at 21:34:38, Robert Hyatt wrote:
>>
>>>>Then you sacrifice performance. Particularly for machines that do not have
>>>>8 bit chars and weird configurations! The performance hit in those cases is must
>>>>be huge. You cannot have 100% portability and best performance at the same time.
>>>>C gives, IMHO, the best compromise. History showed that.
>>>
>>>Actually it doesn't show that.  C was developed 30+ years ago on a very simple
>>>architecture.  The basic language structure has survived for a long time, but
>>>the data types (particularly integer) have really lagged behind, and kludges
>>>like "long long" are the result of short-sightedness...
>>
>>Well, it survived 30+ years, so history is saying something. IMHO, the data
>>types had a lot to do with the success of the language. It allowed to write
>>portable and efficient code for diversed machines with completely different word
>>sizes, and I did not make that up, it really happened.
>
>
>Yes, but not quite like you think.  C is _great_ for working on a specific
>architecture.  Efficient.  Easy to write good code.  Readable.  Etc.
>
>C is _not_ great for writing code that has to run on multiple architectures.

I believe this is false.

>For a comparison, try FORTRAN.  I have run FORTRAN code on 16, 32 and 64 bit
>machines with _zero_ changes to the source, because I could speficy how long
>a variable had to be, precisely, without worrying about "does the architecture
>support this?"

You certainly can write C code that does not need to be changed in other
architectures. If you prefer other languages, that is another issue.

>Yes C is good.  And yes, it _could_ be better, if only the standards committee
>would write a _standard_ with no missing piecse...

I do not criticize the standards committee because they had to acommodate needs
of people that have all sort of different hardware.
You cannot shovel down their throats int32 when the word size of the machine is
36 bits without hurting performance.

Another thing is that I guess that writing C compiler could have been something
relatively easy when a new architecture appeared thanks to the simplicity of the
language.

>>The bottom line is that you do not like the data type structures but I do.
>>It is a matter of taste.
>
>
>It is more than taste.  You might not be as concerned about portability as I
>am.  But in my case, portability is an important issue, and C has some distinct
>problems in that area.  Problems that _could_ be addressed by standards.

I am concerned about portability, not less than you. As I say, it is a matter of
taste. Few things about portability in C are left to the programmer to take care
(like anding with a mask). I do not mind those tasks, it is a little effort that
you have to pay to have the simplest language with the highest portability
possible that does not hurt performance.

Miguel




This page took 0.01 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.