Time to move std.experimental.checkedint to std.checkedint ?

Walter Bright newshound2 at digitalmars.com
Wed Mar 31 07:52:31 UTC 2021


On 3/31/2021 12:31 AM, Vladimir Panteleev wrote:
> - Silicon will keep getting faster and cheaper with time
> 
> - A 7% or a 14% or even a +100% slowdown is relatively insignificant considering 
> the overall march of progress - Moore's law, but also other factors such as the 
> average size and complexity of programs, which will also keep increasing as 
> people expect software to do more things, which will drown out such "one-time" 
> slowdowns as integer overflow checks

If you're running a data center, 1% translates to millions of dollars.


> - In the long term, people will invariably prefer programming languages which 
> produce correct results (with less code), over programming languages whose 
> benefit is only that they're faster.

People will prefer what makes them money :-)

D's focus is on memory safety, which is far more important than integer overflow.


> So, it seems to me that Rust made the choice to only enable overflow checks in 
> debug mode in order to be competitive with the programming languages of its 
> time. I think Zig's design is the more future-proof - there will continue to be 
> circumstances in which speed is preferable over correctness, such as video games 
> (where an occasional wrong result is tolerable), so having distinct ReleaseFast 
> and ReleaseSafe modes makes sense.

Zig doesn't do much to prevent memory corruption. Memory safety will be the 
focus of D for the near future.


> BTW, another data point along Rust and Zig is of course Python 3, in which all 
> integers are BigInts (but with small numbers inlined in the value, akin to small 
> string optimizations).

Python isn't competitive with systems programming languages.



More information about the Digitalmars-d mailing list