Sujet : Re: Python recompile
De : bc (at) *nospam* freeuk.com (bart)
Groupes : comp.lang.cDate : 11. Mar 2025, 14:47:25
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vqpetc$203bs$1@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 25 26 27 28 29 30 31
User-Agent : Mozilla Thunderbird
On 11/03/2025 11:59, Michael S wrote:
On Tue, 11 Mar 2025 11:43:50 +0000
Hint: the ability to type 'make' (one character less than 'mm qq') to
start a build process involving 1000s of files, 100s of directories,
10s of 1000s of lines of scripts, dozens of specialist utilities,
taking several minutes to complete, with myriad failure points, is
NOT what I would count as simpler.
>
>
>
It is far more complicated than yours if all the person wants is an exe.
It is simpler than your process if the person has higher ambitions.
Like fixing bugs or adding features.
I explained about these (1) and (2) requirements in another post.
I suppose that you achieved build simplicity by means of amalgamation.
Actually build simplicity is exactly the same without amalgamation:
c:\qx>mm qq
Compiling qq.m to qq.exe
But here qq.m is the lead module of several dozen comprising the project, plus there are embedded support files.
If distributing source for somebody else to build from scratch however, provided they have mm.exe, then this is a tidy way to do it.
The amalgamation was created like this:
c:\qx>mm -ma qq
Compiling qq.m to qq.ma
Writing qq.ma
The 'mm qq' invocation is a feature of my language which has a module scheme, which lets it discover the dependent source files.
C doesn't have that. I have played around with a few ideas, but they require either a modified C compiler, or some script which extracts build info embedded in the C source.
However this will only work for new programs; it doesn't help with existing open source software where that info is disseminated within various makefiles or scripts.
So the latter still comes down to being able to determine the inputs to feed to a C compiler - basically the list of C files.
The C source /I/ might provide will be transpiled from my original source projects, and will be a single C source file with no headers. For example:
c:\qx>mc -c qc # For Windows target
M6 Compiling qc.m---------- to qc.c
c:\qx>mc -c -linux qc -out:qu # For Linux target
M6 Compiling qc.m---------- to qu.c
Those files can be trivially built on either OS with no makefile:
c:\qx>gcc qc.c # Windows
c:\qx>wsl
root@DESKTOP-11:/mnt/c/qx# gcc qu.c -lm -ldl -fno-builtin # Linux
(Check it works on Linux:)
root@DESKTOP-11:/mnt/c/qx# ./a.out -nosys hello
Hello, World! 11-Jan-2025 13:36:06
(qc.c is a version 'qq' without an ASM-based accelerator module. Inline assembly can't be transpiled to C.)
Do you provide your potential users with de-amalgamation tool, just to
giv'em a minimal chance?
The .ma file is just a text file that concatenates the source and support files, each preceded by a header like this:
=== qq.m 0 0 1/44 ===
A simple script can separate them (or a text editor can do it manually).