
On 2015-08-28 at 11:48:08 +0200, Ben Gamari wrote: [...]
Hmm, interesting. I'm not sure how realistic it is to make this a link-time option, however, considering that we may inline bindings from whatever integer package we compile against into the user's program.
Herbert, do you have any thoughts on this?
It's quite realistic, because we can do this at the C ABI level, where inlining is not an issue. We wouldn't switch between various Haskell packages, but rather between different C libraries, all providing the same API at the C-ABI level. This was hinted at in https://ghc.haskell.org/trac/ghc/wiki/Design/IntegerGmp2 The first step towards that is finding an alternative bignum library (maybe 'bsdnt') that can be modified to operate on the same array-of-limb representation as GMP, and get this working as a GHC build-time configuration option of the `integer-gmp`-package. Once this is accomplished, turning this into a `ghc` link-time flag should be relatively easy. Cheers, hvr