Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Java versus C Speed Comparison

Author: Robert Hyatt

Date: 20:26:49 01/11/03

Go up one level in this thread


On January 11, 2003 at 20:05:48, David Rasmussen wrote:

>On January 11, 2003 at 11:30:44, Robert Hyatt wrote:
>
>>
>>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.
>>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?"
>>
>>Yes C is good.  And yes, it _could_ be better, if only the standards committee
>>would write a _standard_ with no missing piecse...
>>
>>
>
>C is an ugly language by any standards. It just happens to be the language that
>the world has spent the most time making tools and implementations for. Given
>the strength and goals of C, and the years of experience with it's vast amount
>of weaknesses, a much cleaner, simpler, faster, more effecient, more
>expressible, less error prone, and simply much better language could be made
>today that meats the same goals and more. But the focus of language design today
>is not on systems programming languages like C. And on the other hand, which is
>much worse, people use C for all sorts of problems where much superior
>alternatives exist.
>
>/David


I am not convinced that a "better" language can be created, given all the
different ways C is used.  IE pointers are a big headache to many.  Do without
'em.  Use Java.  But many of us rely heavily on pointers.  Ditto for other
ideas that let us get closer to the hardware.  IE Pascal tried to tightly
define all data types.  And then someone discovered that trying to write
compilers in that language was very messy without some sort of "union"-like
facility, and it was added.  And the language became less "pure" and more
"useful" in one stroke.

For many applications, none of this matters.  For time-critical applications,
including operating systems and chess, it matters in a big way.  If I were doing
a math-type program I would probably use APL.  If I were dealing with text
data only, I'd probably use Snobol4.  I've done applications in PL/1 and ADA
also.  Not to mention Cray Blitz (FORTRAN) and things in COBOL.  And basic.
And Algol.  But the more the compiler tries to hide the architecture, the less
useful it becomes for certain applications.

For a high-performance (chess) application, understanding the architecture,
and then being able to "get to" that architecture is critical.  And the mystery
of data type lengths takes away from what is needed.




This page took 0 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.