How about a 100% CTFE?

Gor Gyolchanyan gor.f.gyolchanyan at gmail.com
Mon Nov 7 05:13:34 PST 2011


After reading

    http://prowiki.org/wiki4d/wiki.cgi?DMDSourceGuide
    https://github.com/gor-f-gyolchanyan/dmd/blob/master/src/interpret.c

I had a thought:
Why not compile and run CTFE code in a separate executable, write it's
output into a file, read that file and include it's contents into the
object file being compiled?
This would cover 100% of D in CTFE, including external function calls
and classes;
String mixins would simply repeat the process of compiling and running
an extra temporary executable.

This would open up immense opportunities for such things as
library-based build systems and tons of unprecedented stuff, that I
can't imagine ATM.


More information about the Digitalmars-d mailing list