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
7
u/yorickpeterse Inko May 03 '26
Signed by default makes a lot of sense, and it's the same choice I made for Inko though it's even more strict there as unsigned integers aren't first-class types (as in, you can't define methods for them) and exist for the sole purpose of the C FFI.
One downside is that there are certain APIs that could be expressed more cleanly if you had a non-negative integer, as it would remove the need for runtime checks. One approach I've been thinking about to deal with that is adding support for integer ranges similar to Ada, but it's something I'm not entirely sure about just yet (most notably it will complicate the type system, which I'm trying to avoid).