Hi

>    case Main.$wccall GHC.Prim.realWorld# of wild_X28 { (# ds_d2ad,
> ds1_d2ac #) ->
>
> i.e. it has had an artificial box put around the answer. It may be
> impossible to eliminate this, but if it is, I'd like to try.

There's no actual box here.  The ccall returns an unboxed tuple with two
components, one of which has void type (State# RealWorld), so it has no runtime
representation.  The other component will be stored/returned in a register.
Make sure your ccalls are annotated with unsafe, if you're not already.

That is good news. They are already unsafe.

> I realise all of this trickery is against the spirit of a pure
> functional language, and is making assumptions that are not required
> to remain true. Right now I just want the fastest possible benchmarks
> though.

Ok, but suppose you get some good results - what's the point?  None of this is
guaranteed to work tomorrow.  Why not aim for a robust translation into Core
that preserves the semantics?  It can't be that hard to pass around a State#
RealWorld, can it?

Yhc introduces all the necessary machinery to thread state through
properly - so it starts off semantics correct. I then apply semantics
preserving transformations, which means that the code still includes a
threaded state - its just really hard to see where it went.

Since I seem to have ended up passing an extra Int around as a dummy
state, to stop GHC from CAF'ing stuff, it does seem to make more sense
to use the GHC state from the beginning.

Thanks

Neil
_______________________________________________
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Reply via email to