How hard would it be to create a new backend in D?

rempas rempas at tutanota.com
Sat Aug 6 05:51:16 UTC 2022


On Saturday, 6 August 2022 at 05:28:06 UTC, cmyka wrote:
>
> In what way do you wish to use MIR? A D frontend that generates 
> MIR or some kind of LLVM-MIR pass? Could be an interesting 
> project if not quite ambitious. I wouldn't let the previous 
> user discourage you here. :)

Here's the thing... I don't know! That's the case. I wonder what 
D's frontend
(which is DMD's frontend practically) generates. It has to 
generate some kind
of global IR and then probably LDC takes that and turns it into 
LLVM IR and
GDC takes it and turns it into GCC IR. So I will suppose that it 
has to be some
kind of independent middle representation that DMD does. I don't 
think that
there is another way that things can happen...

So I wonder how I can get started and if the process is 
straightforward because
if it is not, then I may also think about building a language 
that is based on D
or something like that, idk...

As for getting discouraged, I wouldn't see it as if someone tried 
to
discourage me. I think that the guys said their opinion nicely so 
in
any way, I'm still thinking about it. But making my own frontend 
is
still in the corner. The result of this thread will show!


More information about the Digitalmars-d mailing list