Status of GHC runtime dependency on GNU multi precision arithmetic library

Stefan O'Rear stefanor at cox.net
Wed Aug 22 11:24:56 EDT 2007


On Wed, Aug 22, 2007 at 10:32:36AM +0100, Simon Peyton-Jones wrote:
> | There is an interest in removing GMP, motivated partly by licensing but
> | also due to portabiltity concerns and the fact that the use of GHC's
> | memory manager in GMP prevents FFI code from using GMP safely.
> |
> | http://hackage.haskell.org/trac/ghc/wiki/ReplacingGMPNotes
> 
> Just to summarise our position at GHC HQ on this question:


> * We don't much like bundling GMP either.  But it works and it's fast.
...
> * We'd be very happy to have others work on a replacement
>         (a) using a another C library
>         (b) using a Haskell library
...
> * To replace GMP altogether we'd need to be convinced that
>   we would not lose much performance.
...
> * There are one or two arbitrary precision libraries in Haskell
>   eg http://www.haskell.org/pipermail/libraries/2007-August/007909.html

Another possibility that occured to me recently, is to switch Integer
to a simpler (perhaps even pure-Haskell) representation, and provide
(core?  extra?  Hackage?) a hsgmp package.  If you have big numbers,
switching is easy:

import Prelude hiding(Integer)
import Data.Integer.GMP
type Integer = MPZ

Stefan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.haskell.org/pipermail/glasgow-haskell-users/attachments/20070822/b6d55139/attachment.bin


More information about the Glasgow-haskell-users mailing list