zlacker

[return to "Nimony (Nim 3.0) Design Principles"]
1. andyfe+vNb[view] [source] 2025-12-05 13:38:06
>>andsoi+(OP)
> floats can be NaN and integers should be low(int) if they are invalid (low(int) is a pointless value anyway as it has no positive equivalent).

I have long thought that we need a NaI (not an integer) value for our signed ints. Ideally, the CPU would have overflow-aware instructions similar to floats that return this value on overflow and cost the same as wrapping addition/multiplication/etc.

◧◩
2. mikepu+o7c[view] [source] 2025-12-05 15:13:25
>>andyfe+vNb
From an implementation point of view, it would be similar to NaN; a designated sentinel value that all the arithmetic operations are made aware of and have special rules around producing and consuming.
[go to top]