Re:Frama-C is a suite of tools dedicated to the analysis of ...
by detrino on Saturday April 12, 2014 @03:27AM
(#7577243)
I played with Rust for a day and while I was impressed with the language as a whole, I felt the borrow checker left a lot to be desired. I don't think having lifetime of references tied to scope works well in general. This is most evident in pattern matching where you are forced to grab your reference in the pattern (even if you don't need to use the reference until much further on), and there is no way to release it until the end of the scope (even though it can be dead much sooner).
[ Parent
| on HN ]
Re:Frama-C is a suite of tools dedicated to the analysis of ...
by pcwalton on Saturday April 12, 2014 @07:09AM
(#7577565)
Making the borrow checker know about the liveness of variables outside of scope is on the todo list. Like all of the borrow checker, it's fairly tricky to implement properly, but it should be doable. I don't think this issue leaves "a lot to be desired" though; it's a relatively minor tweak on the overall semantics.
Having a borrow check is important, because otherwise you're left with iterator invalidation and numerous other memory safety holes.