Discussion:
[rust-dev] Rust BigInt
Lee Wei Yen
2014-09-19 04:09:20 UTC
Permalink
Hi all!

I?ve just started learning to use Rust now, and so far it?s been everything I wanted in a language.

I saw from the docs that the num::bigint::BigInt type has been deprecated - does it have a replacement?

--
Lee Wei Yen

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/rust-dev/attachments/20140919/d12eaa51/attachment.html>
Daniel Micay
2014-09-19 04:13:28 UTC
Permalink
Post by Lee Wei Yen
Hi all!
I?ve just started learning to use Rust now, and so far it?s been
everything I wanted in a language.
I saw from the docs that the num::bigint::BigInt type has been
deprecated - does it have a replacement?
--
Lee Wei Yen
It was moved to https://github.com/rust-lang/num

There's also https://github.com/thestinger/rust-gmp which binds to GMP.

GMP has better time complexity for the operations, significantly faster
constant factors (10-20x for some operations) and more functionality.

It also doesn't have lots of showstopper bugs since it's a mature library.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://mail.mozilla.org/pipermail/rust-dev/attachments/20140919/8e8ad7c3/attachment.sig>
Matthieu Monrocq
2014-09-19 16:40:01 UTC
Permalink
Post by Daniel Micay
Post by Lee Wei Yen
Hi all!
I?ve just started learning to use Rust now, and so far it?s been
everything I wanted in a language.
I saw from the docs that the num::bigint::BigInt type has been
deprecated - does it have a replacement?
--
Lee Wei Yen
It was moved to https://github.com/rust-lang/num
There's also https://github.com/thestinger/rust-gmp which binds to GMP.
GMP has better time complexity for the operations, significantly faster
constant factors (10-20x for some operations) and more functionality.
It also doesn't have lots of showstopper bugs since it's a mature library.
Disclaimer, for the unwary, GMP is a GPL library; so using it implies
complying with the GPL license.
Post by Daniel Micay
_______________________________________________
Rust-dev mailing list
Rust-dev at mozilla.org
https://mail.mozilla.org/listinfo/rust-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/rust-dev/attachments/20140919/6ded0538/attachment.html>
Jauhien Piatlicki
2014-09-19 16:46:22 UTC
Permalink
Hi,
Post by Matthieu Monrocq
Disclaimer, for the unwary, GMP is a GPL library; so using it implies
complying with the GPL license.
LGPL afaik, so you can dynamically link with it in any case.
Post by Matthieu Monrocq
Post by Daniel Micay
_______________________________________________
Rust-dev mailing list
Rust-dev at mozilla.org
https://mail.mozilla.org/listinfo/rust-dev
_______________________________________________
Rust-dev mailing list
Rust-dev at mozilla.org
https://mail.mozilla.org/listinfo/rust-dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://mail.mozilla.org/pipermail/rust-dev/attachments/20140919/e29239d1/attachment.sig>
Daniel Micay
2014-09-19 20:15:07 UTC
Permalink
Post by Jauhien Piatlicki
Hi,
Post by Matthieu Monrocq
Disclaimer, for the unwary, GMP is a GPL library; so using it implies
complying with the GPL license.
LGPL afaik, so you can dynamically link with it in any case.
Static linking of a proprietary application is fine too, as long as
linkable object files are provided so the user can replace GMP with a
patched / updated library.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://mail.mozilla.org/pipermail/rust-dev/attachments/20140919/b234a2b3/attachment.sig>
Daniel Micay
2014-09-19 20:14:03 UTC
Permalink
On Fri, Sep 19, 2014 at 6:13 AM, Daniel Micay <danielmicay at gmail.com
Post by Lee Wei Yen
Hi all!
I?ve just started learning to use Rust now, and so far it?s been
everything I wanted in a language.
I saw from the docs that the num::bigint::BigInt type has been
deprecated - does it have a replacement?
--
Lee Wei Yen
It was moved to https://github.com/rust-lang/num
There's also https://github.com/thestinger/rust-gmp which binds to GMP.
GMP has better time complexity for the operations, significantly faster
constant factors (10-20x for some operations) and more functionality.
It also doesn't have lots of showstopper bugs since it's a mature library.
Disclaimer, for the unwary, GMP is a GPL library; so using it implies
complying with the GPL license.
Not true. It's under the LGPL license and proprietary applications can
both dynamically link and statically link against it. The end user needs
to be able to replace the library - which is a given with dynamic
linking, and can be done with static linking by providing linkable
object files rather than a binary (or both). Rust itself relies on
plenty of GPL with linking exception / LGPL code like glibc / libgcc /
libunwind.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://mail.mozilla.org/pipermail/rust-dev/attachments/20140919/e5e9968e/attachment.sig>
Loading...