On 26/01/2011 09:52, Roman Leshchinskiy wrote:
Daniel Peebles wrote:
On Tue, Jan 25, 2011 at 5:22 PM, Roman Leshchinskiy

Hmm, come to think of it, could they perhaps be written in Cmm (calling
  memcpy etc. internally) and imported using the (rather obscure) "prim"
  calling convention?


http://www.haskell.org/ghc/docs/7.0-latest/html/users_guide/ffi.html#ff
i-prim

They wouldn't have to be true primops then, i.e., they wouldn't require
  extensions to the compiler itself. I don't know if this is feasible,
though.


I considered that actually, but they seemed of general-enough interest
that I think it'd make sense for them to be primops.

I agree that they are of general interest but that isn't necessarily the
right criterion for determining if something should be a primop. As long
as it's provided, nobody will care how it's implemented except for the
implementers themselves.

Duncan Coutts has
mentioned that foreign import prim wasn't really meant for average library
code.

What we are talking about is definitely not average library code!

Anyway, I don't really care either way, I just thought that the prim FFI
route would be simpler and require less maintenance in the future.

I don't think Cabal supports .cmm files, so if you went that route it would be limited to being a GHC boot package, like integer-gmp.

Cheers,
        Simon

_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to