3 ms·
Anyone interested in using a big integer library, but unwilling to subject themselves to GMP's viral licence, check out LibTomMath (no affiliation): https://www
by tomp 9y ago
Anyone interested in using a big integer library, but unwilling to subject themselves to GMP's viral licence, check out LibTomMath (no affiliation): https://www.libtom.net/ https://www.libtom.net/
- cup-of-tea 9y agoCopyright is viral and copyleft is the cure. But these are just religious issues these days and as such I couldn't convince you to think otherwise. GMP is available under the LGPL.
- kazinator 9y ago> GMP is available under the LGPL. GMP is not a common system API like POSIX, so if you rely on it, you actually have to bundle GMP, or otherwise handle the dependency. LGPL is fine for things like standard C and POSIX, because your program is not tied to that LGPL-ed implementation. The GPL itself recognizes "system library" as a special status. It is permissible for GNU programs to depend on proprietary libraries if they are system libraries. Under very similar reasoning, depending on LGPL-ed libraries is okay in an otherwise completely free program if those LGPL-ed libraries are system libraries. LGPL limits you to dynamic linking, which is gross for this kind of thing. (Have you looked at a dynamic library function call lately?) If you make a language depend on a LGPL library for numbers, that turns into GPL if you have to build a static image for an embedded system. This is not a problem with malloc or printf which you just get from that system, rather than by carrying the GNU C Library into your program. Legally you may be able to get away with adding a LGPLed library to a MIT or BSD program; in practice, licensing is not purely about "what can I legally get away with". What kind of hassles and restrictions will there be factors into it. Also philosophy factors into it: it's ideologically inappropriate for a liberally licensed (BSD, MIT) program to depend on special-purpose, non-system GNU libraries.
- librexpr 9y agoYou can statically link a LGPL'd library without releasing the whole under the LGPL, but you need to provide a way for the user to modify the library and re-link it. See: https://www.gnu.org/licenses/gpl-faq.html#LGPLStaticVsDynamic https://www.gnu.org/licenses/gpl-faq.html#LGPLStaticVsDynami...
- kazinator 9y agoLibTomMath is based on Michael Fromberger's "MPI". I chose MPI for TXR; LibTomMath, though providing some optimizations like Karatsuba multiplication, just brings in too much cruft. Quite a few bugs in MPI, but I have a handle on it. I extended it with bit operations, a faster square root, more conversion routines and such. http://www.kylheku.com/cgit/txr/log/mpi http://www.kylheku.com/cgit/txr/log/mpi I'm familiar with LibTomMath. Tom St. Denis used to post to the comp.lang.c newsgroup years ago. Some 15 years ago I used it (or rather LibTomCrypt, which is based on it) in a commercial project to do some RSA-based authentication on some configuration packets sent to mobile devices.