arturo icon indicating copy to clipboard operation
arturo copied to clipboard

[Helper/bignums] Is there any way *not* to use the GMP/MPFR library?

Open github-actions[bot] opened this issue 1 year ago • 1 comments

[Helper/bignums] Is there any way not to use the GMP/MPFR library?

Right now, Arturo's BigNum handling capabilities are based exclusively on the GMP & MPFR libraries, and available only in the "full" builds. Could we replace them - with whatever shortcomings this might bring? For example: https://bellard.org/libbf/ seems like a good-enough candidate. It's small, fast enough - apparently - written in C, supports Integers and Floats + it's MIT-licensed.

Of course, we could just use it for the MINI builds - for its lack of external dependencies. Or use it for both. Or just have 2 different "full" builds: one with the GMP dependency, and one - slower but - without any dependencies. This could get messy, implementation-wise, but it's definitely doable.

https://github.com/arturo-lang/arturo/blob/ce734e7a32c73173910cdf8f533f56be21febe3b/src/helpers/bignums.nim#L15


# TODO(Helpers/bignums) General cleanup needed
#  labels: helpers, cleanup

# TODO(Helper/bignums) Is there any way *not* to use the GMP/MPFR library?
#  Right now, Arturo's BigNum handling capabilities are based exclusively on the GMP & MPFR libraries, and available only in the "full" builds. Could we replace them - with whatever shortcomings this might bring? For example: https://bellard.org/libbf/ seems like a good-enough candidate. It's small, fast enough - apparently - written in C, supports Integers and Floats + it's MIT-licensed.
#  Of course, we could just use it for the MINI builds - for its lack of external dependencies. Or use it for both. Or just have 2 different "full" builds: one with the GMP dependency, and one - slower but - without any dependencies. This could get messy, implementation-wise, but it's definitely doable.
#  labels: helpers, enhancement, open discussion

#=======================================
# Libraries
#=======================================
ndex f1ae55cb9..7932f7723 100644
++ b/src/helpers/database.nim

d42d0ab986043152309feada1cafe8185451e78d

github-actions[bot] avatar Aug 03 '22 11:08 github-actions[bot]

Yep Bellard's lib is cool - it has even partial support for decimal floats (which I am a loud fan of).

dumblob avatar Aug 03 '22 12:08 dumblob

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Mar 31 '23 12:03 stale[bot]

Closing issue as stale.

stale[bot] avatar Jul 29 '23 16:07 stale[bot]

Closing issue as stale.

stale[bot] avatar Nov 29 '23 01:11 stale[bot]