It's always amazing to me that abstractions are so fragile in practice we still haven't managed to fully abstract over numbers.https://twitter.com/JonMLevine/status/1044950721857298432 …
-
-
See, Rich is the absolutist. I’m the pragmatic one who will allow you a runtime error handler =)
-
Nobody writes runtime handlers that do anything except BUG_ON();
-
In any case, a runtime check is only meaningful with runtime sizing, meaning your language model has allocation going on under the hood, which means it's not suitable for low level programming of any sort.
-
No, a runtime check is useful even without runtime sizing. I may have a computation on i64s that I believe cannot overflow, but I can't prove it to Z3's satisfaction--I'm offering a pragmatic option of "I don't think this will ever happen, but if it does, error out of the \
-
This is equivalent. Just add if (x>K) return error; (or assert) before the arithmetic. No need to put runtime check in the language's def of arithmetic.
-
It's sometimes non-trivial to propagate "no overflow" back to a bound on the inputs. Letting compiler insert `jo` for you is a useful model.
-
Better still when the compiler can insert it *only* where it can't prove that it's unnecessary, and give you that feedback.
-
In some cases it would generate slightly more optimal code, but it makes the language more complex and hard to use, I think.
- 2 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.