On 10/06/2009 15:14, Isaac Dupree wrote:
Simon Marlow wrote:
foreign import prim "has_side_effects commutable foo#" :: ...

note, FFI spec defines lack-of-"safe/unsafe" to mean "safe" (and it's
*not* unsafe in the typical FFI ways, so I think that makes a bit more
sense to me than "unsafe")

If there are features like "can_fail" and "has_side_effects" whose
absence leads to an optimization, it makes me a little uncomfortable
(what if they're not specified when they should be? didn't we have a bug
like that for has_side_effects just recently, even with the primops all
specified in one well-commented file?)

I don't think the situation would be any worse than it is now. These properties have to be specified somewhere, we'd just be changing where.

Also would it be better to call
it "ghcprim" rather than "prim" (then people will be more wary of all
these compiler-specific requirements), or does it not really matter?

Other compilers might implement their own version of 'foreign import prim', but that's not a problem. We're not aiming for portability here. There will be a specific extension flag for GHC's 'foreign import prim', too.

Cheers,
        Simon

_______________________________________________
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to