arturo-lang / arturo

Simple, expressive & portable programming language for efficient scripting
http://arturo-lang.io
MIT License
695 stars 31 forks source link

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

Open github-actions[bot] opened 2 years ago

github-actions[bot] commented 2 years ago

[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

dumblob commented 2 years ago

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

stale[bot] commented 1 year ago

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] commented 1 year ago

Closing issue as stale.

stale[bot] commented 9 months ago

Closing issue as stale.

stale[bot] commented 1 month ago

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.