News for hackers. Stuff that matters.
Re:D Language accepted for inclusion in GCC by jordigh on Wednesday June 21, 2017 @04:38PM (#14607694)
Isn't borrow-checking a sort of compile-time reference counting? Not what people usually think of when they say "reference counting", but I wonder if it's a good way to think of borrow-checking.
Re:D Language accepted for inclusion in GCC by leshow on Wednesday June 21, 2017 @09:05PM (#14609375)
Not really, it doesn't count references in the same way. The borrow checker maintains a set of rules that are more expansive than reference counting. For instance the rule that you may only have one &mut at a time, and no other references as long as &mut is alive. It also has something like linear types with ownership rules, where owned values can be used only once.
Re:D Language accepted for inclusion in GCC by steveklabnik on Wednesday June 21, 2017 @04:50PM (#14607820)
Some people make this analogy, but it has so many caveats, and is so far away from what people think about as RC, and has very serious and significant differences, that I don't think it's a useful analogy, personally. I even might go so far as to say "actively harmful." Not totally sure though.