On Monday, 21 November 2016 at 12:59:26 UTC, John Colvin wrote:

mixin(import("myCode.d"));

Even better because it doesn't have to output the program at runtime, the generated executable *is* the compiled code ;). I guess that's just the same as #include though....

If you want to compile to other languages, just use the above with ldc --output-ll or --output-bc, then get an llvm decompiler to get that to your target language :)

A C compiler using ctfe, now that would take some more work.

I think there is some confusion: a D-CTFE C-compiler is exactly what my OP was about ;)

-Johan

Reply via email to