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

Re: C# and Parrot

Thread Previous | Thread Next
Andy Dougherty
October 18, 2002 05:50
Re: C# and Parrot
Message ID:
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

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About