Hi!
For those interested, I've been working in a wrapper around jovial's GMP bindings: bignum
For the time being, it supports signed integers and rational numbers. In the near future I plan to implement floating point numbers and random numbers.
I'd like to take the opportunity to thank @jovial for his GMP bindings!
Looks nice, but you probably don't want to put module names like int and rat in the global module namespace. I'd recommend using something like bignum.int and bignum.rat instead (and probably also use module names that indicate the use of gmp rather than a generic bignum).
See also this issue.
Yes, @Jehan is correct.
I am planning on getting Nimble to verify that packages don't pollute the namespace and your package currently will not pass this verification. It will be a warning at first but it will become an error.
Yeah, that was a concern at some point in the development process, but as int.nim never was intended as being directly imported by users, I finally forgot about it. But I clearly see your point, it's definitely not a good idea.
On the other hand,
dom96: Can we get a bignum library integrated into the standard library?
I don't know the way Araq wants to go (a pure, but slow Nim implementation; or a wrapper around some fast library (GMP / MPIR, etc.)
To me, being able to show off your hand-written bigint library isn't worth the speed loss.
Interestingly, PyPy's hand-written bigint type is quite fast; maybe someone should check out that algorithm?