Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Current status of this library - ghc 8 support #8

Open
ch1bo opened this issue Nov 24, 2017 · 5 comments
Open

Current status of this library - ghc 8 support #8

ch1bo opened this issue Nov 24, 2017 · 5 comments

Comments

@ch1bo
Copy link

ch1bo commented Nov 24, 2017

Hello,

finding this repo is really a relief to me, as there seems to be some progress on the no-libgmp haskell front. In the project I am currently working for we can't use LGPL licensed libraries and thus need to make do with integer-simple. I am currently building this and trying to get this working with our projects, but thought I might ask via an issue what the current status of your big-integer-experiment is? The readme states that only ghc-7.10.3 would work - is ghc-8.0.2 also possible? Are there things which are known to be not working? Is there something my team and I could help with?

@erikd
Copy link
Owner

erikd commented Nov 25, 2017

Current status is that it is incomplete.

The library has a full implementation of addition and subtraction that is complete and performs pretty well in comparison to libgmp. Unfortunately multiplication is still about 5x slower and I haven't found a way to improve that yet. This library is however significantly faster than integer-simple in just about all tests.

The README was incorrect. GHC 8.0 and later should work. The Readme has been updated.

As for help, there is nothing easy left to do. I need a faster way of doing multiplication.

@ch1bo
Copy link
Author

ch1bo commented Nov 25, 2017 via email

@erikd
Copy link
Owner

erikd commented Nov 25, 2017

In its present state, it is not ready as a drop in replacement for integer-simple. In addition integer-simple and integer-gmp are pretty much baked into the GHC compiler. I do not think its easy to just drop in a replacement.

@ch1bo
Copy link
Author

ch1bo commented Dec 13, 2017

Hello,

I successfully tested the pacakge on ghc-8.0.2 and ghc-8.2.1. The performance increase looks promising to us, but after more detailed investigation (in fact, only after I was already compiling this for ghc stage1) I realized that you use base and primitive packages quite a lot in implementation. When integrating with ghc, the integer libraries are built very early - only ghc-prim is available and the Integer implementation is required to compile base.

So I guess this is what you meant with your last comment that it is not ready to integrate with ghc straight away.

What resources did you use when developing the implementation? I saw the code has some similarities with integer-simple - was gmp of any use?

Thanks for your comments so far!

@erikd
Copy link
Owner

erikd commented Dec 14, 2017

The use of base and primitive was mainly to make development easier while I was debugging the algorithms. When it if fulliy working, those could be dropped/replaced.

The main resource I used was the arithmetic I learned in school, Wikipedia and just general Haskell resources like Stackoverflow etc. There really isn't anything in this code that is very complicated. I may well have started with integer-simple just to get the type signatures correct. I probably haven't spend much time looking at the integer-gmp version because all the details are buried in the C code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants