> Using uint for "cannot be negative" is just wrong -- unsigned "integers" wrap > around and are more like bitvectors than they are numbers.
So the real issue is just that wrapping is the default while it would better be explicit. Anyway, it's too late, we're stuck with this like Lua with their 1-based indexing. > According to the manual Nim supports subrange types, so is type Offset = > range[0..high(int)] more idiomatic for declaring non-negative arguments for > functions dealing with strings? There's already `Natural` and `Positive` in `system`. Use them as much as possible. Don't know why they couldn't be `uint` with saturating/checked maths, though. Probably because you need to drop checks for release mode and somehow wrapping is considered a more severe error than UB.