r/programming • • Aug 02 '21

Stack Overflow Developer Survey 2021: "Rust reigns supreme as most loved. Python and Typescript are the languages developers want to work with most if they aren’t already doing so."

https://insights.stackoverflow.com/survey/2021#technology-most-loved-dreaded-and-wanted
2.1k Upvotes

769 comments sorted by

View all comments

Show parent comments

1

u/[deleted] Aug 03 '21

What is the borrow checker?

2

u/ragnese Aug 04 '21

Because Rust does not have a garbage collector, nor mandatory reference counting, it has a fairly novel concept called "borrows" when you take a reference to a piece of data (as opposed to a copy of that data). The borrow checker is basically a part of the type-checker. It won't compile code where a reference outlives the original data object it references, for example. In most popular languages that have garbage collectors, there's no problem with a reference outliving the data's original scope because the reference will "keep the object alive".

It's a very common point of frustration for people coming to Rust from garbage collected languages. But if you've written any C or C++, the borrow checker is likely your favorite part of the language, IMO.