So how extremely could I exploit this? Could I write a program entirely in C, compile it with the D compiler, and use D's unit test framework? That would be insane (very good insane, obviously).
echo hello.c
int printf(const char*,...);
int main() { printf("hello world\n"); }
dmd hello.c
./hello
hello world
But then there's the question "should D features be allowed in the C code?" This is a very subversive question. Is it really C if that is allowed? Already, the C code allows for Compile Time Function Execution, which comes for free by passing the C code through the D front end. You can see it in action in the test cases in this file: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.
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.