18024, "mppf", "Details of two flavors of asserts", "2021-07-01T20:39:53Z"
Follow-up to #16810 and #12466.
Related to #13603.
We're thinking that we would like to have two different variations on
- one would be always on (even with
- one would be toggle-able with a
chplflag and normally be disabled with
The rationale for having some
assert be able to be always on is that if a program is encountering a bug that would lead to undefined behavior it would be better to fail fast rather than possibly running in to any other horrible consequence that could come from the undefined behavior. Nonetheless, an always-on assert is not a substitute for using
throw or other reasonable error handling techniques in libraries.
Rust has this idea and calls the always-on one
assert and the disabled-in-release
The goal of this issue is to discuss and try to sort out the details.
- Should the default
assertbehavior be toggled off with
- Should we have different methods like
debugAssert, or should we have an optional argument to
assertthat indicates which of these it is? What are the exact names of these functions / arguments?