CTFE and DI: The Crossroads of D

foobar foo at bar.com
Wed May 9 13:46:58 PDT 2012


On Wednesday, 9 May 2012 at 20:14:32 UTC, Steven Schveighoffer 
wrote:
> On Wed, 09 May 2012 15:57:46 -0400, Adam D. Ruppe 
> <destructionator at gmail.com> wrote:
>
>> The real WTF is we use .di files for druntime in the
>> first place. It is performance sensitive and open source.
>>
>> We should be using the actual sources for inlining, ctfe,
>> etc. anyway.
>>
>> Let's not torpedo the .di patch's value for just phobos.
>
> I agree (although not generating .di files does not fix all the 
> problems of inlining and ctfe -- there are many stubbed 
> functions even in the .d files).
>
> In my opinion, .di generation should by default generate 
> fully-stripped code except for templates.  If you want 
> functions to be CTFE-able, don't use auto-generated .di files 
> to import them.
>
> -Steve

This makes sense.
So this means the datetime example would fail to compile when 
using druntime's .di files. This should be emphasized in the 
spec/docs to minimize the chance for gotchas for users.

We could add an exception to this rule by tagging functions with 
e.g. "export". What do you think?


More information about the Digitalmars-d mailing list