New blog post on the cost of compile time

Steven Schveighoffer schveiguy at gmail.com
Thu Jan 19 17:44:50 UTC 2023


On 1/19/23 11:56 AM, Commander Zot wrote:
> On Thursday, 19 January 2023 at 16:39:17 UTC, Steven Schveighoffer wrote:
>> On 1/19/23 11:22 AM, Commander Zot wrote:
>>> On Thursday, 19 January 2023 at 15:19:06 UTC, Steven Schveighoffer 
>>> wrote:
>>>
>>>> I think we can all agree though that it is less than ideal to have 
>>>> to worry about the internal details of how templates are implemented.
>>>>
>>>
>>> i disagree with this.
>>> - it makes the library harder to maintain.
>>> - it hides the actual problem.
>>> - people writing their own code will still be left with the problem.
>>
>> I'm not sure I understand your disagreement with the quote.
>>
>> I think we are saying the same thing?
>>
> maybe i misunderstand your point, but let me express my thoughts a bit 
> more:
> 
> we should worry about the internal details of how templates are 
> implemented. they should be implemented in the most idiomatic way.

Yes, this is what I said "less than ideal to have to worry about the 
internal details". Ideally, we should be able to use as much templates 
as we want, and pay a minimal cost.

Now, to be sure, we are going to pay a cost. It just shouldn't be so 
expensive that it causes abandonment of D for it (some recent examples 
noted on these forums).

Making Phobos constraint templates less costly is a worthy goal, whether 
it's done via reducing the cost of templates overall, or finding less 
expensive ways to implement them. Worth noting that the compiler can't 
just be completely magic, sometimes you do have to rearrange things to 
get it to work better.

-Steve


More information about the Digitalmars-d mailing list