Thread overview
Re: We need to clarify if 'real' is the 'default floating point type' or not.
Mar 04, 2008
renoX
Mar 04, 2008
Ameer Armaly
Mar 06, 2008
JMNorris
Mar 06, 2008
Ameer Armaly
March 04, 2008
Ameer Armaly Wrote:
> Maybe we just ought to make int whatever type is fastest, and call the current int something different, maybe dword?

So int would mean 8 bit integers?
I'm joking but for some operation 8 bit int *are* 'fastest' than 32 bit int, because they use less cache, memory..

Anything else that intX, uintX is necessarily arbitrary (and even intX is not that simple: some DSP have 24bit integers..), so I'm not sure that it's quite useful to spend too much time on that topic.

renoX


March 04, 2008
"renoX" <renosky@free.fr> wrote in message news:fqj8i1$1m01$1@digitalmars.com...
> Ameer Armaly Wrote:
>> Maybe we just ought to make int
>> whatever type is fastest, and call the current int something different,
>> maybe dword?
>
> So int would mean 8 bit integers?
> I'm joking but for some operation 8 bit int *are* 'fastest' than 32 bit
> int, because they use less cache, memory..
>
> Anything else that intX, uintX is necessarily arbitrary (and even intX is not that simple: some DSP have 24bit integers..), so I'm not sure that it's quite useful to spend too much time on that topic.
>
I don't know why I didn't think of this earlier: auto. If you want optimal int types, isn't that part of the  rationale behind type inference?
> renoX
>
> 


March 06, 2008
"Ameer Armaly" <ameer.armaly@furman.edu> wrote in news:fqjl0e$2mi4$1@digitalmars.com:

> I don't know why I didn't think of this earlier: auto. If you want optimal int types, isn't that part of the  rationale behind type inference?

I assume you're proposing a change in the way auto works.  Currently for:

    auto x = 5 < 7;

x has type bool.
March 06, 2008
"JMNorris" <nospam@nospam.com> wrote in message news:fqonmv$25gh$1@digitalmars.com...
> "Ameer Armaly" <ameer.armaly@furman.edu> wrote in news:fqjl0e$2mi4$1@digitalmars.com:
>
>> I don't know why I didn't think of this earlier: auto. If you want optimal int types, isn't that part of the  rationale behind type inference?
>
> I assume you're proposing a change in the way auto works.  Currently for:
>
>    auto x = 5 < 7;
>
> x has type bool.
Not really. Suppose you're on a 64-bit machine.
auto x = 5;
should yield a long, where as on a 32-bit machine it should yield an int
It's not perfect by any stretch, but it's easier given the current
circumstances.