3 ms·
In Jai it is easy to, for example, have bounds checks on during the entire development process to aid in finding bugs, then turn off bounds checks in a dozen cr
by erikpukinskis 11y ago
In Jai it is easy to, for example, have bounds checks on during the entire development process to aid in finding bugs, then turn off bounds checks in a dozen critical loops for testing and release, then turn bounds checking on in one loop that still proved crash-y.
Blow has said many times: he doesn't think the language should be prevent you from shooting yourself in the foot, because sometimes that means preventing you from doing what you want to do.
He usually asks: what is something simple we can do that will give us 90% of the benefit, without adding a layer of overhead. Rather than Rust's "Safe All The Things!" approach, bounds checking is just another tool you can use or not use as is appropriate for the context.
- pcwalton 11y ago> In Jai it is easy to, for example, have bounds checks on during the entire development process to aid in finding bugs, then turn off bounds checks in a dozen critical loops for testing and release, then turn bounds checking on in one loop that still proved crash-y. That's pretty much exactly Rust's philosophy as well. > Rather than Rust's "Safe All The Things!" approach, bounds checking is just another tool you can use or not use as is appropriate for the context. Rust's philosophy is not "Safe All The Things". It has "unsafe" for a reason. Anyway, I really dislike the overfocus on bounds checks, because they're pretty much zero overhead if properly implemented and optimized.
- agentultra 11y agoMost Common Lisp implementations, for what it's worth, take this approach as well. For tight loops where you've removed the invariants and proved its bounds removing the run-time checks can give a non-trivial performance boost to production systems.
- zurn 11y agoIf you mean the (speed 3 safety 0), it's more in line with pcwalton's idea to have a switch for generally turning off safety checks, not just bounds checks - because the other checks typically affect performance more.
- steveklabnik 11y agoMost of the checks affect compile time performance in a minor way, but also have no runtime overhead. The borrow checker is an entirely compile-time thing, for example.