Re:Adding ANSI C11 C compiler to D so it can import and comp...
by crazypython on Monday May 10, 2021 @07:46AM
(#27104877)
> Already, the C code allows for Compile Time Function Execution, which comes for free by passing the C code through the D front end.
Oh my good gosh. D and C could be seamless together. This is great.
> I decided to flirt with heresy and leave this in
I'd love to see more C language extensions in ImportC.
https://github.com/dlang/dmd/pull/12507/files#diff-b94776a02...
Scroll down a bit and you'll see it executes C functions at compile time. I decided to flirt with heresy and leave this in, because it sure makes adding tests convenient!
I'm less sure about adding unittests to the C compiler. Certainly, you can always add the unittests to the D code that is importing the C code. This will probably hold the charges of abomination to a minimum.