Operator declaration

Nick Treleaven nick at geany.org
Sat Apr 25 10:49:35 UTC 2026


On Friday, 24 April 2026 at 21:00:52 UTC, Meta wrote:
> On Friday, 24 April 2026 at 14:59:25 UTC, Nick Treleaven wrote:
>> On Thursday, 23 April 2026 at 20:30:04 UTC, Meta wrote:
>>> Now that we have ImportC, maybe he he can be convinced to 
>>> soften his stance a bit.
>
> The arguments from that section are:
> - 32-bit integer operations are often faster than smaller 
> integer types for single variables on modern architectures.
>
> I'm not an expert in modern CPU architecture, but I'm extremely 
> skeptical of this claim. I doubt the difference is even 
> noticeable with modern compiler optimization techniques.

That was the argument Walter made in 2022 'this has carried over 
into modern CPUs':
https://forum.dlang.org/post/stk4sr$97t$1@digitalmars.com

I don't know enough to comment on that.

> - Promotion helps avoid accidental overflow which is more 
> common with small integer types.
>
> I got 3 words for you: Value Range Propagation. We pay for it, 
> so we should use it wherever possible.

How would that fix the problem? And ideally in a way that doesn't 
break existing working code.



More information about the Digitalmars-d-learn mailing list