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

rempas rempas at tutanota.com
Sat Aug 6 08:44:26 UTC 2022


On Saturday, 6 August 2022 at 08:31:16 UTC, user1234 wrote:
>
> You'll have to read DMD code to get familiar with its code base 
> (another way in the past was fixing bugs, unfortunately there 
> are not much easy ones anymore). Fortunately you'll dont have 
> to understand the whole thing. In a first time I'd suggest you 
> to follow the lifetime of one particular construct and that for 
> each big family of node.
>
> Choose
> - a Type (maybe the one for `int`)
> - a Statement (maybe the ReturnStatement)
> - a Declaration (the FunctionDeclaration)
> - an Expression (maybe the IntegerExp).
>
> Try to follow what is happening during the different passes.
> That way you'll have a good idea of what the compiler does for
>
> ```d
> int i(){return 0;}
> ```
>
> and where you could generate MIR stuff.

Thanks my friend! I'll try to read and understand the code and If 
I end up been
able to create anything, I'll shared it here! Have a great day!


More information about the Digitalmars-d mailing list