Sujet : Re: Python recompile
De : bc (at) *nospam* freeuk.com (bart)
Groupes : comp.lang.cDate : 07. Mar 2025, 19:02:23
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vqfcbe$3lkkc$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
User-Agent : Mozilla Thunderbird
On 07/03/2025 14:09,
Muttley@DastardlyHQ.org wrote:
On Fri, 7 Mar 2025 14:00:13 +0000
bart <bc@freeuk.com> wibbled:
On 07/03/2025 09:53, Muttley@DastardlyHQ.org wrote:
Note that if downloadeding pre-built binaries, you will usually have a
separate binary file for each platform. The same here: a separate C file
per platform.
Not sure why you think that makes things simpler. Just means you could end
up with 10x the number of files unless you have a different source package
for each platform.
Sure, because downloading the source code for all conceivable platforms is so simple!
I just (well, nearly 2 hours ago!) downloaded the sources for gcc. It was 0.75GB in all, 142,000 files, 5,500 folders. There are 84,000 .c files, and 4,600 .h files.
It took something over 90 MINUTES to unzip, using a SSD.
I haven't started to look at what's involved in building it for Windows Actually I haven't got a clue how to go about it. Neither do I know how long it might take.
Is this what you mean by 'simpler'?
It is hard enough downloading ready-made binaries, which I now do from here: winlibs.com. There is a selection of ZIP files which contain the various binaries, headers etc which are needed for the built compiler to do its job.
So people expect a binary download of a product to be a single binary, for which there is commonly a selection, for example Windows/32-bit or Windows/64-bit; or maybe .MSI/.ZIP, or maybe for MacOS.
For large products however it will be a ZIP file or installer, rather than the single EXE which /is/ the product in my case.
What I provide is that same selection, but the file extension is .c. You need a C compiler to turn it into a .exe file.
To contrast with building gcc, here is how you might build my (C compiler) product from source, if you were on Windows and were happy to use my binary. You need the two files ccp.ma and mm.exe here:
c:\demo>dir
11/02/2025 20:13 578,187 ccp.ma
16/08/2024 19:28 70 hello.c
05/03/2025 13:38 402,432 mm.exe
'ccp.ma' is the amalgamated source and support files in the original language that I would provide. mm.exe is the compiler:
c:\demo>mm ccp
Compiling ccp.m to ccp.exe # (gets renamed to bcc.exe)
Now it can be used as a C compiler, here using '-r' to run immediately:
c:\demo>ccp -r hello
Compiling hello.c to hello.(run)
Hello, World!
Alternately the compiler itself could be run from source without generating ccp.exe:
c:\demo>tim mm -r ccp -r hello
Compiling ccp.m to ccp.(run)
Compiling hello.c to hello.(run)
Hello, World!
Time: 0.072
Building the C compiler then running it to build and run hello.c took under 0.1 seconds. (The timing excludes command shell overheads that might be 0.02 seconds, since this is normally done within an IDE.)
This is literally magnitudes smaller, faster, simpler and easier than working from gcc sources.