<div dir="ltr"><div dir="ltr"><br></div><div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Nov 15, 2019 at 5:04 PM Sylvain Henry <<a href="mailto:sylvain@haskus.fr">sylvain@haskus.fr</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Question is: do we need/want to keep this behavior? </blockquote><div><br></div><div>Yes ;-)</div><div><br></div><div>I chose it quite intentionally after benchmarking and carefully examining various approaches, and with the intent to use a common-denominator representation which would be easy to supplement with alternative bignum implementations.</div><div><br></div><div>Since you didn't seem to reference it, I wonder if you even saw the page where some of my design rationale was written down as well as hinting at how I intended to make the backend selectable via a link-time flag (similar to how you'd select the RTS via -threaded or -prof, you'd also be able to select the integer backend at link-time w/o the need to recompile anything). See</div><div><br></div><div><a href="https://gitlab.haskell.org/ghc/ghc/wikis/design/integer-gmp2">https://gitlab.haskell.org/ghc/ghc/wikis/design/integer-gmp2</a><br></div><div><br></div><div>However, some time ago I did discuss picking up that plan again, but he did point out that it would make a lot more sense to leverage Backpack for this, as it seems to be a much more elegant solution to this problem than the simple but platform-specific link-time approach I was aiming for. Ben put it quite bluntly that if Backpack can't be used for this thing it was basically designed for, we should consider ripping it out again as it would have effectively failed its promise.</div><div><br></div><div>And I do agree! Back when I originally redesigned and rewrote integer-gmp from scratch, Backpack wasn't available yet. But now we have it, and a Backpack based solution would IMO indeed be the proper solution at this point to the problem of abstracting over integer-backends as well as representations -- it could even be combined with my original plan for C FFI based platforms (but that's mostly an optimization at that point for the special case where the backends share said common representation at the ABI level).</div><div><br></div><div> </div><div><br></div></div></div>