Comment by gronpi
2 days ago
Deferring to runtime is not always great, since not only can it incur runtime overhead, the code can also panic if a violation is detected.
2 days ago
Deferring to runtime is not always great, since not only can it incur runtime overhead, the code can also panic if a violation is detected.
Using `try_borrow`/try_borrow_mut` should avoid panics, but yes, the overhead is why it's the exception rather than the rule, and it has to be done manually with these types. I'm not making a value judgment on the utility of working with that model, only pointing out in response to the parent comment that one of the things they mention is somewhat possible today, at the cost of having to update code. Even if it were possible to do it seamless as I'm assuming they're talking about, I don't really think it would be possible to do without incurring _any_ runtime overhead, but I think that's kind of their point; it might be nice to be able to switch between models when doing different types of development.