Sujet : Re: Python recompile
De : chris.m.thomasson.1 (at) *nospam* gmail.com (Chris M. Thomasson)
Groupes : comp.lang.cDate : 12. Mar 2025, 20:59:57
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vqsp3u$2pfdp$2@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
User-Agent : Mozilla Thunderbird
On 3/12/2025 3:37 AM, David Brown wrote:
On 11/03/2025 22:18, bart wrote:
On 11/03/2025 20:20, David Brown wrote:
On 11/03/2025 18:47, bart wrote:
>
<https://packages.msys2.org/packages/mingw-w64-ucrt-x86_64-gmp>
<https://packages.msys2.org/packages/mingw-w64-ucrt-x86_64-libffi>
>
The compressed tarballs include the dlls.
>
I downloaded a couple of large files, including mingw64-x86_64- gmp-6.3.0-1-src.tar, but found no trace of any DLL files.
>
You downloaded the source tarballs, and are surprised to find they contain source files - not binaries? Did the abbreviation "src" not give you a clue?
>
You said the 'tarballs include the dlls'. I associate tarballs with source code, so I was mildly surprised, but I looked anyway. The other file was mingw-packages.master.zip, but it would have taken forever to unzip the lot looking for one file that probably wasn't there.
>
A tarball is just a bunch of files collected together. It can be anything - not just source code.
There also seems to be a variety of binary packages for gmp, from the base package at <https://packages.msys2.org/base/mingw-w64-gmp> . These might be more or less appropriate, depending on the other libraries or toolchains in use.
>
>
Try the link that is labelled "File:" - it is the msys2/mingw-w64 tarball with libgmp-10.dll and all the other files shown in the list at the bottom of the page, under "Files:".
>
So: https://mirror.msys2.org/mingw/ucrt64/mingw-w64-ucrt-x86_64- gmp-6.3.0-2-any.pkg.tar.zst, obviously.
>
Yes.
>
Meanwhile here is the library *I* had to use instead:
>
https://github.com/sal55/langs/tree/master/bignum
>
>
It is not exactly comparable, is it?
>
No. Mine was available when I needed it a decade or so ago. GMP dlls were everywhere, mostly on dodgy-looking sites but every one was different. Then you had the job of finding a matching gmp.h file.
Based on the "view changes" page, the msys2 GMP binaries have been around since about 2013. (Again, I have no idea of their suitability or compatibility for your needs.) And the package contains a gmp.h file.
I am happy to believe that it is easier to get such packages now than it was a decade ago - I had no interest in searching for them at that time, and no interest in them now. If I need to use GMP on Windows, I can just install it with msys2 (in fact I see it is already installed on my Windows system). Before msys2, I could have got it from msys or Cygwin. Someone else has already done the work of porting and compiling to make it work on Windows - why would I bother trying to duplicate that effort?
>
If all you need is some simple arithmetic done in a naïve school long multiplication way, then the code is fine.
>
I needed support for big numbers in my interpreter. My product is well-integrated, and represents 5% of the 250KB interpreter size. The above gmp DLL is 666KB so is a poor match.
>
Out of curiosity - how often are such big numbers needed and used with your interpreter, excluding demos to show how to use big numbers? 64-bit arithmetic is enough for the huge majority of purposes outside of cryptography and mathematics, and 128-bit arithmetic covers almost all of the rest. Your code is not suitable for cryptography or mathematics. So what is it used for? And could it have been handled much more simply by using 128-bit fixed sizes?
Fwiw, deep zooms on fractals is one reason why I use it.