Zig 2024 roadmap
Zig 2024 roadmap
Posted Feb 5, 2024 15:36 UTC (Mon) by khim (subscriber, #9252)In reply to: Zig 2024 roadmap by atnot
Parent article: Zig 2024 roadmap
> In a hypothetical world where overflow checking was enabled by default
…Rust would have played the role of “new Haskell”: something which people talk about but don't use, except for a few eggheads and then rarely.
> And millions of mysterious production bugs and a hundred CVEs would have been avoided, at barely any cost to most programmers and one extra profiling iteration of a thousand for a few people writing heavily integer math code.Nothing would have been avoided because Rust would have been just ignored. Rust, quite consciously, used up it's weirdness budget for other, more important, things.
Perhaps Rust with slow-integers-by-default would have saved someone from themselves, but chances are high that it would have hindered adoption of Rust too much: people are notoriously finicky about simple things and seeing these dozens of checks in the program which should be, by their understanding, two or three machine instructions long would have gave Rust a bad reputation for sure.
> This is just based on just testing my own programs.If you are happy with that mode then why couldn't you just enable it in your code? -Z force-overflow-checks
exists precisely because some people like these overflow checks.
I'm not big fun of them because in my experience for hundreds of bugs where some kind of buffer is too small and range checks are catching the issue there exist maybe one or two cases where simple integer overflow check is capable of catching the issue which is not also caught by these range checks. Certainly not enough to warrant these tales about millions of mysterious production bugs (why not trillions if you go for imaginary unjustified numbers, BTW?)
Posted Feb 5, 2024 16:26 UTC (Mon)
by atnot (subscriber, #124910)
[Link]
You're just making my own arguments back at me now, but snarkier. I said this two messages ago.
Look, I like Rust too, it's my personal language of choice. There's no need for this level of aggressive defensiveness over someone on the internet thinking it would be useful to make some pretty marginal tradeoff differently. With the data we have, I'm convinced it makes sense today and I've explained why. You're welcome to disagree.
Zig 2024 roadmap