D interpreter

Chad J gamerChad at _spamIsBad_gmail.com
Wed Oct 24 20:05:33 PDT 2007


Robert Fraser wrote:
> Bruce Adams Wrote:
>> Gregor Richards Wrote:
>>> The CTFE interpreter is extremely limited (and slow).
>> Maybe it should use a VM? :)
> 
> That sounds like a lot of work & overhead for what basically ammounts to constant folding. Remember, CTFE is a compile-time optimization, not a way to execute the program.
> 
> That said, CTFE with a GC and heap-allocation support would be nice, since my code uses a lot of objects.

CTFE is limited and problematic enough that it feels like some kind of 
stop-gap measure to me.

I'd feel better if it was eventually going to be replaced by something 
more elegant.  Something like the compiler compiling the CTFE code and 
dynamic linking to it, then calling it as needed.  I know there are 
security concerns about this, but just address them.  No ASM, no 
external linking except for "safe" things like the stdlib, no pointer 
manipulations that could access the compiler's memory space, etc.  But 
jeeze, let us use arrays and classes.



More information about the Digitalmars-d mailing list