I tried to describe this in [1]: "Unsigned integer are intentionally not supported to simplify learning and using the language, to avoid surprising behavior and edge cases, and to reduce security issues and error-handling pitfalls. When needed, unsigned behavior is available through explicit operations. This design does not affect performance or memory usage."
I understand this may not sound very convincing yet... it is hard to describe... basically, unsigned types sound simple, but they are not.
Hmm, I don't quite follow. For usages like counters or version numbers, it seems like allowing negatives makes things more complicated rather than less.
Like, what if you're getting a u32 over the wire? I feel like using an i32 to represent that data makes it more error-prone. Numbers will unexpectedly appear to be negative?
thomasmg|14 days ago
I understand this may not sound very convincing yet... it is hard to describe... basically, unsigned types sound simple, but they are not.
[1] https://thomasmueller.github.io/bau-lang/features.html
ycombinatrix|12 days ago
Like, what if you're getting a u32 over the wire? I feel like using an i32 to represent that data makes it more error-prone. Numbers will unexpectedly appear to be negative?