r/ProgrammingLanguages • u/Nuoji C3 - http://c3-lang.org • May 03 '26
Blog post Unsigned Sizes: A Five Year Mistake
https://c3-lang.org/blog/unsigned-sizes-a-five-year-mistake/
91
Upvotes
r/ProgrammingLanguages • u/Nuoji C3 - http://c3-lang.org • May 03 '26
View all comments
Show parent comment
2
u/initial-algebra May 07 '26
It's a tradeoff. With wrapping, you get nice algebraic properties. With trapping, you get nice ordering properties. Sometimes you want one, sometimes you want the other, so it should be explicit. Though, in the case of dealing with sizes, offsets, pointers, data structures etc. you almost always want trapping, except for special cases like ring buffers, so I think it's a sane default for a systems language.