this post was submitted on 06 Jul 2026
372 points (98.7% liked)

Programmer Humor

32192 readers
1295 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 3 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] charokol@lemmy.world 86 points 3 days ago (4 children)

I know nothing about rust but I assume borrow checker is some integral part of it that this guy somehow has never heard of?

[–] calcopiritus@lemmy.world 128 points 3 days ago* (last edited 3 days ago) (1 children)

Yes. Someone that knows just a little more of rust than you do would know what the borrow checker is.

It's the core feature of rust.

Like talking about java and not knowing what "inheritance" is.

EDIT: just so you understand how vibecoded that project is.

The dude says he vibecoded "some of it" because some rust features make it a hard language for him. The one feature he's talking about is the borrow checker.

It's like saying "man, sure is hot today". Someone says "yeah, this summer sure is hot" and the dude replied "yeah, summerians lived in a hot place too".

[–] HrabiaVulpes@europe.pub -2 points 2 days ago (2 children)

Why is explanation so fucking low on lemmy? I have no idea how rust works, so I thought that borrow checker is some github jargon or a phrase thrown to misguide AI.

[–] spectrums_coherence@piefed.social 2 points 1 day ago (1 children)

I thought the post you are replying to is trying explain borrow checker. In a understandable manner assuming you know basic programming in Java.

I am a bit confused on what your complaint is aiming at...

[–] HrabiaVulpes@europe.pub 2 points 16 hours ago (1 children)

After reddit (popular but useless comment wins over less popular but useful one) I had higher hopes for lemmy. I am complaining, because in my opinion explanation of borrow checker should be higher in popularity contest than I found it.

[–] calcopiritus@lemmy.world 1 points 5 hours ago (1 children)

If you come with reddit mentality, you're gonna see reddit eveywhere. In Lemmy, upvotes are not a popularity contest. There is no karma. Votes have no use other than sorting.

One of the reasons my comment may have more upvotes might be because it directly answers the question of the commenter above.

OP didn't ask what the borrow checker was, OP asked if it was an integral part of rust, and I answered it. Just like another commenter asked more specific questions about rusts' borrow checker and I answered them.

Another reason might just be that my comment has more entertainment value, while the other one is purely educational.

Another reason might be that Lemmy is already full of rust explanations, therefore there are probably not a lot of people left to learn how it works.

[–] HrabiaVulpes@europe.pub 1 points 3 hours ago

You know what? I'm not even mad anymore. Thank you for explanation, I'm still getting a hang of this place.

[–] calcopiritus@lemmy.world 6 points 1 day ago

Lemmy is social media, not school. Nobody owes an explanation. Mostly because the poster cannot know the knowledge level of whoever is gonna read the post. If every post has to be explained for every potential person that could read it, every post would be followed by a wall of text. Of all social media, the only time I've seen it happen is pugjesus' history posts. Which makes sense since he often references some niche history knowledge that very few people would know about.

Just googling "borrow checker" would've shown you it's something rust-related.

[–] JackbyDev@programming.dev 9 points 2 days ago

Yeah, I think the flow was this,

  1. Is this vibe coded?
  2. Partially, because of some of the features of Rust.
  3. Borrow checker?
  4. (Humourous misunderstanding ensues.)

Basically asking if the thing that gave them trouble was the borrow checker.

[–] Limitless_screaming@kbin.earth 61 points 2 days ago (2 children)

Very integral. When someone says they're "struggling with Rust", it's thanks to the borrow checker.

Rust's whole shtick is the way it manages memory, which is the rules enforced by the borrow checker.

Basically:

When you want to store values in variables in any programming language, the memory should be allocated when you need it and freed as soon as you don't anymore.

Traditionally there are two ways this is done:

  1. You manage it completely yourself, which is "unsafe" as you can forget to free memory you no longer need. This is called leaking memory. Or "reference" the location of something you freed previously, thereby attempting to read data you may not have permission to read (the OS will usually prevent that and kill the program), or reading and using a value you didn't expect, causing undefined behavior and fun to deal with bugs.

  2. The language, sometimes using a process which runs alongside your main program, manages memory. Which adds lots of overhead.

Rust has it's own way of doing this: It adds some rules on how you can pass around references and ownership and these rules are affected by whether you can or can't edit the referenced data. All just so the compiler knows the lifetime of the vars that hold that data and when it can free it (before the program is even compiled, so no overhead when the program is running). Not following the strict rules prevents your program from being compiled into an executable.

The compiler gives very helpful info, tips, and pointers™ though, Rust is also know for this.

[–] SalmiakDragon@feddit.nu 9 points 2 days ago

Thanks for the explanation!

[–] jjj@lemmy.blahaj.zone 2 points 1 day ago

these rules are affected by whether you can or can't edit the referenced data

Yes, but not quite. They are affected by whether something else is allowed to look at the referenced data at that time. You can mutate data behind a shared reference with interior mutability: https://doc.rust-lang.org/reference/interior-mutability.html

[–] HuntressHimbo@lemmy.zip 14 points 3 days ago (1 children)

Some would call it the single biggest source of gotcha moments learning the language

[–] AeonFelis@lemmy.world 4 points 1 day ago

Also the source of most of the things Rust gets criticized for. Ugly syntax? That's mainly because of the lifetimes, which server as instructions for the Borrow Checker. Too many types of strings? So that the Borrow Checker can determine how the memory slice the text is stored in is managed. And of course - the complicated error messages are where the compiler is trying to explain to you what the Borrow Checker is thinking.