On Sat, Mar 29, 2014 at 12:19 AM, Daniel Micay <danielmi...@gmail.com> wrote:
>> This is unfair.  You're mixing up static checks such as
>> exhaustiveness, freezing, and lifetimes, which have no performance
>> impact (or at least, the performance impact caused by their
>> limitations would be mitigated only by fundamentally rearchitecting
>> the user code, not flipping a check off), with dynamic checks such as
>> array bounds, RefCell, and division, which have an impact and can be
>> flipped off.
>
> These do often have a performance impact despite being static checks.
> The borrow checker forbids many valid patterns, and forces either a less
> efficient solution or using `unsafe`. This is no different from how you
> are forced to choose between safe indexingand unsafe indexing.

As I said, if you want to use the more efficient solution in that
case, you have to rewrite the code to be unsafe-only anyway, so there
is no (well, very little) downside to using special syntax rather than
making the existing syntax do something different.  With dynamic
checks, it is not usually necessary to rewrite.

> seems to be a serious misunderstanding about bounds checking in Rust in
> this thread. The bounds check is *not* a dynamic check inserted to make
> sure that the code is valid. It is a normal runtime check, like checking
> if a string is valid when parsing it into an integer. There is a
> semantic difference between that and assuming the string is valid.

This is one of the arguments I was not disagreeing with.  But from the
pragmatic perspective of getting numbers for Science, I doubt any
actual Rust code depends on this distinction.
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to