Sujet : Re: transpiling to low level C
De : bc (at) *nospam* freeuk.com (bart)
Groupes : comp.lang.cDate : 17. Dec 2024, 00:36:03
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vjqdh3$1bld5$2@dont-email.me>
References : 1 2 3 4 5 6 7
User-Agent : Mozilla Thunderbird
On 16/12/2024 21:59, Keith Thompson wrote:
BGB <cr88192@gmail.com> writes:
[...]
If I were to estimate a feature set for a 3AC IL:
Basic UNARY and BINARY operators;
Also COMPARE and similar;
Load and Store Index operators;
With support for an immediate index;
GOTO
IF-GOTO
CALL (with a list of argument variables and a target variable).
>
One doesn't need any higher-level control flow constructs.
[...]
Have you looked at C-- (cminusminus)?
https://en.wikipedia.org/wiki/C--
I looked at it perhaps 15 years ago. I got the impression it was dead.
According to your link (which might be broken, the "--" could be missing when clicked), it was discontinued in 2013, and the only form of it exists inside GHC, which uses various special backends specific to that product:
"GHC backends are responsible for further transforming C-- into executable code, via LLVM IR, slow C, or directly through the built-in native backend"
I can't see that is available as a general purpose ready-to-use backend for other languages, and for the targets that people might want (eg. x64 for Win64).
Or if there was, how practical it might be, in terms of compile-speed, code quality, output options etc. If it has to be fed to LLVM, then you might as well use LLVM directly.