Universal Function Attribute Inference

ryuukk_ ryuukk.dev at gmail.com
Sat Mar 9 21:26:23 UTC 2024


On Saturday, 9 March 2024 at 20:33:35 UTC, Richard (Rikki) Andrew 
Cattermole wrote:
> On 10/03/2024 9:07 AM, Walter Bright wrote:
>> The main difficulty with this is it requires the compiler to 
>> compile all the functions in the "header" files. This is a 
>> significant performance penalty. That is why the current 
>> scheme only infers for functions that the compiler must 
>> compile anyway, such as templates and auto functions.
>> 
>> I'm not necessarilly saying "no", just that everyone should be 
>> aware of this.
>
> There is some concern with multi-step builds yes.
>
> However we do have a solution that while it isn't ready for use 
> today, it could be made ready once a preview switch has been 
> implemented.
>
> The .di generator.
>
> It could be a while until we could turn the preview switch on, 
> perhaps two or three editions.
>
> A bit of an adjustment yes, but the benefit means no more 
> attribute soup to write for non-virtual code so I expect it to 
> be worth it!

If there is a significant build penalty, than i hope it's opt-in, 
i personally do not use any of the attributes


More information about the dip.ideas mailing list