develooper Front page | perl.perl6.internals | Postings from October 2002

Re: C# and Parrot

Thread Previous | Thread Next
From:
Andy Dougherty
Date:
October 18, 2002 05:50
Subject:
Re: C# and Parrot
Message ID:
Pine.SOL.4.10.10210180845390.23102-100000@maxwell.phys.lafayette.edu
On Fri, 18 Oct 2002, Rhys Weatherley wrote:

> Leopold Toetsch wrote:
> 
> > > What is the size of the "int" type?  Will it always be 32 bit
> > > or is it "whatever is best for the machine"?
> > 
> > It's a Configure option.
> 
> That may be a bit of a problem, as C# (and Java for that matter)
> is very particular about the sizes for its types, and the
> behaviour of operations.  e.g.
> 
>     int x = (0x80000000 + 0x80000000) / 2;
> 
> This will give 0 on a 32-bit system, but 0x80000000 on a 64-bit.
> 
> Note: I'm not criticising Parrot's choice to use native integers.
> It just would be nice for a compiler to be able to say "this type
> must be n bits because I say so!".

While that sounds reasonable to want to do, it is, alas, very very hard.
One significant underlying problem is that, on some platforms where we
want Parrot to run (e.g. some Crays) there simply *is no 32-bit type*.  
short, int, and long are all 64 bits.  I have no idea what C# or Java
would do on such a platform.

-- 
    Andy Dougherty			 doughera@lafayette.edu


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About