FreeBSD/amd64 registerised running

Neil Mitchell ndmitchell at
Fri Apr 13 09:53:51 EDT 2007


> > 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.

Possible, I'll have to think about this further. I was thinking along
the lines of

newtype Box a = Box !a

then Int# = Box Int

but I'm not sure if that will work or not. Anyway, its only a question
of efficiency, and Yhc has a lot more things that will destroy
efficiency than this!

> 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#).

We loose 2 bits, to leave room for enough tag bits. Fortunately this
still fills the Haskell specification. We will have some method for
implementing Int32, probably as a pointer once again.



More information about the Glasgow-haskell-users mailing list