I&#39;d be more than willing to tackle flipping things over to use foreign prims, so that I have something I can build on top without requiring the contortions to get a ghc build with integer-simple. <div><br></div><div>Dan has a cabal buildable library with foreign prims to use as a model.</div>
<div><br></div><div>Is the google code repository up to date?<div><br></div><div><div><div><div>-Edward Kmett<br><br><div class="gmail_quote">On Fri, Mar 4, 2011 at 3:27 PM, Daniel Peebles <span dir="ltr">&lt;<a href="mailto:pumpkingod@gmail.com">pumpkingod@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">According to Duncan Coutts (whom I asked about this issue in #ghc), the solution here is to use the new foreign import prim machinery to talk to MPFR. This prevents GC from occurring during the MPFR calls and will make everything work nicely without reimplementing GMP.<div>

<br></div><div>Dan<div><div></div><div class="h5"><br><div><br><div class="gmail_quote">On Fri, Mar 4, 2011 at 3:09 PM, Daniel Peebles <span dir="ltr">&lt;<a href="mailto:pumpkingod@gmail.com" target="_blank">pumpkingod@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Have you submitted a bug report to GHC of why it can&#39;t work with the current integer-gmp binding? I know that GHC&#39;s collector is collecting MPFR&#39;s temporary data, but maybe it&#39;d be good to get a discussion going on what can be done to stop it from doing this even in the context of the existing integer-gmp + GHC&#39;s allocator (even if this needs to be a patch to MPFR to talk to GHC a bit here and there). Might it help to go through CMM like the GMP binding does, for example?<div>


<br></div><div>I&#39;d really like to see libraries that use GMP work nicely with GHC, without going and reimplementing GMP more slowly and so on.</div><div><br></div><div>Dan<br><br><div class="gmail_quote"><div>
2011/3/3 Michal Konečný <span dir="ltr">&lt;<a href="mailto:mik@konecny.aow.cz" target="_blank">mik@konecny.aow.cz</a>&gt;</span><br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear all,<div><div></div><div><br>
<br>
I am pleased to announce hmpfr-0.3.2, a new version of Aleš Bizjak&#39;s bindings<br>
to the MPFR arbitrary precision floating point arithmetic library.  The<br>
changes in this version are quite small but significant:<br>
<br>
- support for MPFR 3.0.0 as well as MPFR 2.4.*<br>
- dependency on integer-simple instead of integer-gmp<br>
<br>
The latter is most significant because unfortunately it makes it rather more<br>
difficult to install hmpfr.   Currently almost all binary distributions of ghc<br>
have integer-gmp compiled in to provide the Integer type via the standard GMP<br>
library.  Also haskell platform 2010.2.0.0 assumes that ghc has been compiled<br>
with integer-gmp although it makes no specific use of it.  Instructions on how<br>
to compile ghc and haskell platform with integer-simple instead of integer-gmp<br>
are on:<br>
<br>
<a href="http://code.google.com/p/hmpfr/wiki/GHCWithoutGMP" target="_blank">http://code.google.com/p/hmpfr/wiki/GHCWithoutGMP</a><br>
<br>
The rationale for this change is the fact that despite much effort hmpfr is<br>
very unreliable on ghc that includes integer-gmp due to ghc deallocating GMP<br>
data that was allocated by MPFR at unpredictable times.<br>
<br>
Aleš and I hope that hmpfr can return to using integer-gmp once the proposal<br>
<br>
<a href="http://hackage.haskell.org/trac/ghc/wiki/ReplacingGMPNotes#BinaryDropinReplacementforGMP" target="_blank">http://hackage.haskell.org/trac/ghc/wiki/ReplacingGMPNotes#BinaryDropinReplacementforGMP</a><br>
<br>
to replace gmp with a modified gmp in ghc is implemented and made the default.<br>
<br>
Best regards,<br>
Michal<br>
<font color="#888888">--<br>
|o| Michal Konecny &lt;<a href="mailto:mikkonecny@gmail.com" target="_blank">mikkonecny@gmail.com</a>&gt;<br>
|o|    <a href="http://www-users.aston.ac.uk/~konecnym/" target="_blank">http://www-users.aston.ac.uk/~konecnym/</a><br>
|o|    office: (+42) (0)121 204 3462<br>
|o| PGP key <a href="http://www-users.aston.ac.uk/~konecnym/ki.aston" target="_blank">http://www-users.aston.ac.uk/~konecnym/ki.aston</a><br>
</font><br></div></div><div>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
<br></div></blockquote></div><br></div>
</blockquote></div><br></div></div></div></div>
<br>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div><br></div></div></div></div></div>