www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Is it possible to implement a C backend for the D language

reply electricface <electricface qq.com> writes:
https://kristoff.it/blog/zig-self-hosted-now-what/

C backend
We are also working on a special backend, one that produces C 
source code. Progress on the C backend has recently shot forward 
(87% and counting) thanks to an amazing contribution.

What's interesting about this backend is that it will play a role 
in our plan to replace the old bootstrap compiler implementation 
and, perhaps even more interestingly, it will allow Zig to target 
architectures not supported by LLVM, including ones that force 
you to use a specific C compiler, like certain game console 
platforms.
Oct 25 2022
next sibling parent FeepingCreature <feepingcreature gmail.com> writes:
On Wednesday, 26 October 2022 at 01:47:29 UTC, electricface wrote:
 https://kristoff.it/blog/zig-self-hosted-now-what/

 C backend
 We are also working on a special backend, one that produces C 
 source code. Progress on the C backend has recently shot 
 forward (87% and counting) thanks to an amazing contribution.

 What's interesting about this backend is that it will play a 
 role in our plan to replace the old bootstrap compiler 
 implementation and, perhaps even more interestingly, it will 
 allow Zig to target architectures not supported by LLVM, 
 including ones that force you to use a specific C compiler, 
 like certain game console platforms.
Neat also uses a C backend for bootstrapping. With DMD released from the need to stay C++ compatible for bootstrapping, you could even start using Phobos and slowly modernizing the codebase.
Oct 25 2022
prev sibling parent Walter Bright <newshound2 digitalmars.com> writes:
Yes, it's possible. One can take the intermediate code generated for the dmd 
backend, and generated C with it instead.
Oct 26 2022