Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Java versus C Speed Comparison

Author: Robert Hyatt

Date: 14:36:11 01/09/03

Go up one level in this thread


On January 09, 2003 at 12:44:50, Matt Taylor wrote:

>On January 08, 2003 at 16:06:38, Dieter Buerssner wrote:
>
>>On January 08, 2003 at 11:31:36, Miguel A. Ballicora wrote:
>>Much snipped.
>>
>>>short --> not smaller than char
>>[...]
>>>I do not remember now whether a short can be smaller than 16 bits.
>>
>>No, it can't. My emphasis was on the fact, that the types were well defined,
>>while Matt said, that the sizes were not. Not really a contradiction, also
>>depends, on what is meant by "well defined".
>>
>>Regards,
>>Dieter
>
>My recollections of old K&R C are similar to Miguel's.
>
>My definition of "well-defined" is "unambiguous without regard to machine."
>While short, int, and long are unambiguous in the context of a -specific-
>machine, they are very ambiguous in general.
>
>Anyway, C99 is 4 years after Java was introduced by Sun. The point I've made
>stands here: Java had a 64-bit type before C standardized on it. It is more
>likely then for people to make use of this in Java, and that spearheads
>optimization of code generated for 64-bit types on Intel. Obviously this is
>different for other platforms.
>
>As a matter of personal opinion, I find the idea of a "long long" silly. I would
>rather use an "int64" when I want a 64-bit type and a plain "int" when I want a
>type whose size is irrelevant (e.g. index to an array). In the spirit of K&R,
>int should be 64-bits on a 64-bit platform. It is disappointing that this is not
>always the case.
>
>-Matt


I think the entire concept of "short", "int" and "long" are badly flawed.  It
would
have been so much more logical and clean to simply go with int16, int32 and
int64.

I don't personally like "long long" as it is a syntactical oddity in light of
char, short, int
and float/double.




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