Add ImportC compiler to dmd

Ola Fosheim Grostad ola.fosheim.grostad at gmail.com
Mon May 10 09:31:58 UTC 2021


On Monday, 10 May 2021 at 09:14:02 UTC, Basile B. wrote:
> On Monday, 10 May 2021 at 08:09:23 UTC, Ola Fosheim Grostad 
> wrote:
>> On Monday, 10 May 2021 at 02:12:02 UTC, Adam D. Ruppe wrote:
>> ...
>> It makes more sense to reuse clang and emit llvm IR.
>
> Except that llvm IR is not understood by DMD, also llvm IR is 
> post-semantic.
> So you you have to take the opposite path, i.e IR -> AST, which 
> is quite unusual.
>
> Anyway, this is is not a bad idea, let's say for a another 
> project.

No, you take a C-expression in D, use an external tool/library to 
obtain the semantics of the resulting expression. Then you 
compile and link at IR level.

Anyway, I suggested the approach Walter is taking here years ago, 
but at this point there are more critical issues on the table... 
This is a diversion from adressing the hard issues.


More information about the Digitalmars-d mailing list