FreeBSD/amd64 registerised running

Simon Marlow simonmarhaskell at gmail.com
Fri Apr 13 09:48:06 EDT 2007


Neil Mitchell wrote:
> Hi
> 
>> How do you plan to implement unboxed types?  AFAIK, implementing 
>> unboxed types
>> requires a typed intermediate language.  Maybe you could get away with 
>> boxing
>> all the unboxed types, but then Int would have an extra level of boxing.
> 
> Indeed, we intend to box everything. Plus there were compilers which
> did unboxing before having unboxed types - as the paper said, it
> wasn't as neat, but it was possible.

Right, but the problem is that if you box all of GHC's unboxed types, you end up 
with an extra layer of boxing compared to an implementation that just boxes 
everything.  ie. it'll be worse than YHC is currently, so you'll need extra 
trickery to get back to where YHC is now.

> I also have a design for a C
> backend where the Int can be packed into the pointer, which removes
> the boxes from all evaluated Ints.

Presumably you lose one bit of precision though, so GHC's Int# type would be 31 
bits.  We did at one stage have a GHC->OCaml translator with a 31-bit Int#, so 
it might be possible, but I think there will be some assumptions in the 
libraries that break (eg. Int32 will need to be implemented using Int64#).

Cheers,
	Simon



More information about the Glasgow-haskell-users mailing list