Universal Function Attribute Inference

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Sat Mar 9 20:33:35 UTC 2024


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!


More information about the dip.ideas mailing list