4 ms·
Rust already supports switching between borrow checker implementations. It has migrated from a scope-based borrow checker to non-lexical borrow checker, and ha
by pornel 1y ago
Rust already supports switching between borrow checker implementations.
It has migrated from a scope-based borrow checker to non-lexical borrow checker, and has next experimental Polonius implementation as an option. However, once the new implementation becomes production-ready, the old one gets discarded, because there's no reason to choose it. Borrow checking is fast, and the newer ones accept strictly more (correct) programs.
You also have Rc and RefCell types which give you greater flexibility at cost of some runtime checks.
- 9304279049 1y ago[dead]
- creata 1y agoI think GP is talking about somehow being able to, for example, more seamlessly switch between manual borrowing and "checked" borrowing with Rc and RefCell.
- gronpi 1y agoThe new borrow checker is not yet all that fast. For instance, it was 5000x slower, according to a recent report. https://users.rust-lang.org/t/polonius-is-more-ergonomic-than-nll-but-why-hasn-t-it-been-integrated-into-the-stable-or-nightly-channels-yet/129749/4 https://users.rust-lang.org/t/polonius-is-more-ergonomic-tha... >I recommend watching the video @nerditation linked. I believe Amanda mentioned somewhere that Polonius is 5000x slower than the existing borrow-checker; IIRC the plan isn't to use Polonius instead of NLL, but rather use NLL and kick off Polonius for certain failure cases.