Sujet : Re: Motivation of tccc mainatainers (Was: Python recompile)
De : bc (at) *nospam* freeuk.com (bart)
Groupes : comp.lang.cDate : 14. Mar 2025, 00:32:21
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vqvpu6$453t$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
User-Agent : Mozilla Thunderbird
On 13/03/2025 22:02, Lawrence D'Oliveiro wrote:
On Thu, 13 Mar 2025 12:08:42 +0000, bart wrote:
* It only works on Linux
At least it’s not restricted to x86 code: it does ARM and RISC-V (both 64-
bit) as well.
But it’s only a code generator,
Actually the project is simple enough to build on Windows (and is considerably smaller if not using the makefile).
But the x64 output produced won't run on Windows.
and code generators shouldn’t be relying
on any advanced OS features like namespaces or event loops or like that;
it should be a piece of cake for somebody with your Windows development
skills to port it ... shouldn’t it?
If you compare with my own backend, if built into a standalone program:
Does yours handle any other target architecture besides x86?
It handles x64 for Win64 ABI, and could be adapted or x64 SYS ABI, but I don't have enough motivation for that (and little reason).
If other people were involved, then they could write a backend for my IL for their target of choice, since part of it is finding a tidy and simple IL to work with.
* The input is simpler stack-based code with no SSA requirements
How efficient is the generated code, by comparison?
I don't have enough examples of SSA programs to judge.
From the tests I did manage, they were about the same in performance (but comparing on WSL vs on Windows).
Maybe you know of a real compiler that can produce suitable inputs for QBE?
The only downside is its poorer code (mine is somewhat better than
tcc's and seems to match QBE on the few benchmarks I tried).
Any fool^H^H^H^Hcompiler class undergraduate can output stack-based code.
And a lot of them do.
The stack code applies to the IL. The generated x64 code is register based. But if it's all so easy, there should be plenty of such projects about. There aren't.