4 ms·
Any ideas on how one can simplify the borrow checker?
by verdagon 5y ago
Any ideas on how one can simplify the borrow checker?
- timClicks 5y agoYou could implement it as a runtime check
- pjmlp 5y agoUse a garbage collected language instead. Eventually as optimization point, for the few use cases where the ultimate performance is needed, provide a subset of borrow checker capabilities. Examples of current efforts into this direction, D, Swift, Haskell, Chapel, some .NET ongoing research.
- mbStavola 5y agoNiko Matsakis, of Rust's lang and compiler teams, has a talk[1] on how the machinery behind borrow checker is being rethought. The idea is that in the future, the compiler won't really "check borrows" but will instead "track origins." Reframing the system in this way will (hopefully) make things be flexible enough to Just Work™ without surprises, while providing the same guarantees as the current borrow checker. The video itself has a motivating example or two that shows where this stuff would be helpful. [1]: https://youtu.be/_agDeiWek8w https://youtu.be/_agDeiWek8w
- mbStavola 5y agoFor those who don't want to sit through a video there is also the book[1]. [1]: https://rust-lang.github.io/polonius/ https://rust-lang.github.io/polonius/