CTFE and DI: The Crossroads of D

foobar foo at bar.com
Wed May 9 13:36:25 PDT 2012


On Wednesday, 9 May 2012 at 19:49:07 UTC, deadalnix wrote:
> Le 09/05/2012 21:27, Adam Wilson a écrit :
>> Questions? Comments? Rants? Raves?
>> What do you think?
>>
>
> You miss the point of the importance of CTFE. It « just » 
> allow us to get the fastest possible regex engine given the 
> regex is known at compiletime (common case) for instance.
>
> This is a major feature of D.
>
> Maybe an interpretable bytecode solution is the key. But 
> clearly the situation is not satisfying.
>
> Annotation could also be used to provide hint for the di 
> generator. This feature had great interest. And is something 
> powerful we should build on, when in place.
>
> Finally, di generator should do a part of the semaintic work to 
> work fine. auto must be resolved, and non CTFEable code could 
> be safely removed. This is already a major improvement.

CTFE is interpreted and requires the source code. Moving this to 
a byte-code interpreter isn't really progress IMO. Are we to 
implement a subset of a JVM inside the compiler now?

We already have a fast native compiler. Ideally, it should be 
possible to run binary obj code directly. This however requires a 
lot of infrastructure change and a lot of thinking to figure out 
how to handle cross-compiling. This is most definitely possible - 
but does require effort. I don't know if it will ever happen, 
even for a future D3 (or 4, or 5, etc..)



More information about the Digitalmars-d mailing list