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

user1234 user1234 at 12.de
Fri Aug 5 22:09:44 UTC 2022


On Friday, 5 August 2022 at 20:37:19 UTC, rempas wrote:
> I was wondering how easy it would be to create a new backend in 
> D? From what I know all of the tree DMD, LDC and GDC are using 
> the same frontend which is the one from DMD. So I would suppose 
> that there is a way to do that and that probably DMD has 
> evolved over the years to make its frontend more portable. 
> However, how strain-forward is it? Is it legit to do it or will 
> it require "hacking" (if you understand what I mean). So it's 
> not about working hard but if the work makes sense or if I'll 
> constantly find obstacles that no one would be able to help me 
> with.
>
> I know some of you will ask so, I want to use 
> [mir](https://github.com/vnmakarov/mir) as a backend because of 
> it's fast compile times and it's great runtime performance! So 
> yeah, not a question purely out of curiosity!

I think you can try things without writing a backend. If I 
believe the diagram of what currently works that seems possible 
to use LDC to produce LLVM IR and then MIR in theory could use 
that, but MIR does not produce native executables so why ?


More information about the Digitalmars-d mailing list