As someone who does a lot of freelance and occasionally gets “do it for the exposure” types of gig offers, my go-to response is usually “people die from exposure when they can’t pay their rent.”
Also, you came to me to offer me the gig. I didn’t do any extra work to get you in my inbox. You found my contact info and reached out to me, so I clearly don’t need more exposure.
Sloppers spend so much time talking with their shitbots that they tend to use similar vocabularies and prose. Some of them do have AI write up their responses, too. Some of them even integrate Grok directly into their keyboard.
I hate that I've conditioned my own vocab and tone on the same kind of formal writing that these models have been trained on. I've used en-dashes long before they became a hallmark of botspeak. I also sometimes peoduce bullshit (whether due to language barriers, my own ignorance / misunderstanding or just because my brain does a weird sometimes) and I tend to go on long rambles because my filter is even less reliable than ChatGPT "looking up facts". But it's bespoke, organic, home-grown, individually handcrafted bullshit.
Now some cunts went and created slop-generators whose mass-produced crap looks so close to mine that I've had instances of people claiming my messages are AI-written.
Lay it on me. Maybe I'll convince myself that I'm a bot after all. Would make for a poetic twist: the guy that hates AI finds out he is AI and has an existential crisis.
More seriously, that does raise a good question. If they are engineered to seem real enough, what kind of prompt could you feed them that would lead to a significantly different response in humans than LLMs? Just how do we have to construct Turing Tests in this era?
Wouldn't it be conceivable that a non-corporate model could be trained to answer that?
But also, I've never dabbled with piracy myself. Not much of a movie person, myself, and mostly play online games. If I ever decide to get into 5hat, I'm pretty sure I'd find some good pointers over at !piracy@lemmy.dbzer0.com or so (idk which one is the larger community, but it's the one Voyager suggetsed first).
Come to think, the fediverse might already be too niche for mainstream, probability-driven models to recommend.
Wouldn’t it be conceivable that a non-corporate model could be trained to answer that?
Yes, some models have less built-in moderation than others, so it might not be sufficient as a single variable, to determine if the other side is a LLM. But it will trip up some at least.
I also like how they claim it's completely different to KRunner and then, save for OCR and whatever "circle to search" is, these are all features in KRunner.
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".
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.
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.
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.
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.
I think it's fine for people to give the most cursory explanation here, just enough to help someone understand what's funny. There are plenty of other sites where one can learn about Rust's borrow checker in more detail, and this is a humor community.
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:
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.
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.
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
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.
Rust is very popular because is as low level as C but has memory safety features builtin, so it is considered the best of both worlds. So basically what you said is correct.
(Disclaimer: I am not a Rust programmer, I prefer C/C++)
Low level goes way beyond raw pointers. But yes, rust does have raw pointers.
Java does have raw pointers too I believe though. I wouldn't call it low level.
But low level is not well defined. At some point, the difference between low level and high level used to be whether you had to write a different program for each computer architecture. Under that definition, C is a high level language. Assembly (and very old languages) would be low level.
My own definition of low level is: if you have to care at all about memory management, it's low level.
Basically, if the language has a garbage collector or if it automatically counts references without you explicitly telling it so, it's a high level language for me.
Doesn't Rust's safety guarantees mean automatic reference counting? Or am I misunderstanding. I guess it means more like happening dynamically at runtime.
You can reference count, but you must do so explicitly, just like in C++ you have to explicitly use std::shared_ptr, in rust you must explicitly use std::rc::Rc.
Rusts' memory safety is managed at compile time, that's what the borrow checker does. It enforces a strict set of simple rules that guarantee at compile time that all the references are valid when they are used. This means that there is no runtime cost.
Q: "Why would you use Rc then? It would only introduce runtime overhead that is not needed because rust already checked that the program is correct"
A: the borrow checker ensures that your program is valid. However, not all valid programs are allowed by the borrow checker. That is what unsafe is for. unsafe allows you to skip some rust safety features if you want to make a program that is valid but rejected by the "safe" rust compiler. Rc uses unsafe internally to expose an API that is safe, but allows you to do things that would normally be rejected by rust.
Of course, the borrow checker is not all the safety features of rust. There are some safety features that actually do have runtime checks.
For example, you can try to access invalid memory by reading out of the bounds of a buffer/array. Most of the time, it is impossible/impractical to solve for this at compile time. Therefore, a bounds check is done on every array access, if the check fails, the program crashes. That check is done at run time. Many times the compiler will optimize those checks, but sometimes they just cannot be optimized out.
I really need to keep my (actual) programming skills up to date, because they might be worth a ton of money in some years when everyone will need to unfuck their vibe coded bs.
TBH I only occasionally do some C# and C++ for about 20 years in my spare time, but even if I were hypothetically qualified to fix the world i'm kind of just planning to sit back and watch all of the sloppers go bankrupt for ruining their companies.
Even if the pay is good - unfucking vibed code is going to be very grueling. Like fixing legacy code but so much worse - because legacy code at least used to make sense at some point in the past.
Bold of you to assume anyone is going to care enough to hire professionals to fix old software. They're just going to vibe code a new program with the new whizbang-5000 LLM.
Devs on my team are straight up saying in the sprint retros that the code is slop and needs to be modified after AI makes the suggestion. Our repo is being flooded with garbage that works out of the gate but costs so much extra to troubleshoot when it fails.
You're using the wrong language. If it fails, it never worked out of the gate. You should say that it seemed like it's working, but never actually did.
My favorite is seeking feedback on reviews on stuff we own and people not responding and being like “I’m sorry I had Claude create 500+ PRs I can’t possibly respond to everything”
Yes, I have always enjoyed trying to create elegant architecture and code, more than I get satisfaction from the end result. I've always found it frustrating how many colleagues were prepared to throw together any old junk as long as the right thing came out in the end. On the positive side, maybe the AI does raise the quality of what some of them contribute.
This is funny, and I do think it's fair to take little jabs at vibe coders, but just be careful. When I was learning to play a game in the past I asked a question. People thought the answer was obvious because the rules were on the thing I was asking about, but I was so new to the game I didn't even know what those words meant. If this was any other context, I'd be hesitant to give someone flak for not knowing a technical term like that. (The context being that somebody vibe coded something.)
On the contrary, the borrow checker is basically the first thing you learn about when writing in Rust as it's the primary "gimmick" of the language. Anyone writing a non-trivial program should have at least heard the term before, even if they don't fully understand how it works.
but I was so new to the game I didn't even know what those words meant
There's nothing wrong with being new to something. But you shouldn't be new to rust and releasing an app. Normally by the time you've written such an app you would be familiar with rust, but vibe coding allows you to bypass that wall
Eh, I don't really see a problem with releasing an app before you "should" release one. I don't think the world improves by discouraging amateurs from sharing their work. Now whether they actually try to learn and grow or just keep vibe coding, who knows.
I can see that actually. I guess the post points out two things:
the dev being a a bit deceitful, downplaying their use of AI when clearly the project is like 90% AI
the community being frustrated by the lack of quality signals in the new world. Previously programming took a lot more effort, so just the existance of an app already meant that the dev was mildly competent. And at the very least it meant that the dev could fix and maintain the app when something broke. Now those trust signals are gone.
I'm not sure if your comment means you're rusty (heh) or a novice who hasn't tried programming in a while, so I'm sorry if this comes across as condescending. The best advice I try to give everyone is to chase the fun. That advice applies both to people learning and hobbyists doing stuff.
I see a lot of folks argue about what's the best way to begin or where the best place to begin is. There's no best way. Everything builds into each other. You become a better programmer regardless of what language you choose.
Rust was fun! I fiddled with it a bit a few years ago. The only real frustration I had was that it complained a lot about half correct programs. Like in other languages I may have just been able to put some bad code or something in some place I didn't really care about and wasn't focusing on, but Rust is very strict. It's been long enough now that I forget exactly what specifically bothered me. It could have just as easily been that it was because I didn't know it well so the compiler was just the messenger of that lol. Other languages could have just blown up at runtime.
I'm more a novice that hasn't programmed in a while. Did a 2 year course above higschool but below uni, and worked as intern for two months, but apart from that haven't really programmed as I don't know what to do if not given a goal.
I've heard a lot of good things about the book "automate the boring stuff with Python." It focuses on practical examples more than the theory. It's also available for free since it is licensed under Creative Commons. That said, I haven't personally checked it out. Just mentioning it as something that focuses on goals and works towards accomplishing them, which sounds like what you're looking for.
Rust takes a lot of getting used to if you’re more familiar with C-derived languages but it’s very cool. I’d recommend something small and not needing asynchronous code to begin with (async Rust is… hairy)
I do not get it. Aside from the fact that the supposed "creator" writes a bit like he processes every sentence through AI-translation software... which might as well be reddit feature.
The borrow checker is a feature of Rust's compiler which places strict constraints on ownership of data to guarantee memory safety. It adds a lot of friction to writing Rust code if you're not experienced with the language (or sometimes even if you are). OP refers to the "language restriction of Rust", seemingly talking about the borrow checker, but has never even heard of it. It's kind of like someone claiming they didn't vibecoded their C++ project but having no idea what the STL is.
Yes, the end goal is very similar to a garbage collector. Both are advanced systems of memory management.
The most important difference being that a garbage collector runs at runtime, while the borrow checker at compile time. Which means that the borrow checker has 0 impact on the program's performance. It just takes longer to compile the program.
Which also means that, while the garbage collector says "you can do whatever you want with memory, don't worry about it, I'll handle it for you". The borrow checker says "you fucking donkey. Why did you do that? I won't compile this if you don't fix it".
So you trade programmer comfort for performance (end user comfort).
The amount of programmers who have no idea what the borrow checker is kinda baffles me. You don’t need to know how to write rust to know what the borrow checker is.
108 Comments
one_old_coder@piefed.social · 182 pts · 55d
Rust has no restriction. The restriction is in his brain high on AI.
That's not how any of this works, he's crazy.
Quetzalcutlass@lemmy.world · 157 pts · 55d
The language restriction of not knowing the language.
mabeledo@lemmy.world · 98 pts · 55d
MF thinks GitHub has “like and subscribe”.
JackbyDev@programming.dev · 7 pts · 54d
Fork me on GitHub!
a_non_monotonic_function@lemmy.world · 5 pts · 54d
Sorry, called finger instead.
eager_eagle@lemmy.world · 64 pts · 55d
don't you guys pay your rent and buy food with github stars?
mic_check_one_two@lemmy.dbzer0.com · 13 pts · 54d
As someone who does a lot of freelance and occasionally gets “do it for the exposure” types of gig offers, my go-to response is usually “people die from exposure when they can’t pay their rent.”
Also, you came to me to offer me the gig. I didn’t do any extra work to get you in my inbox. You found my contact info and reached out to me, so I clearly don’t need more exposure.
eah@programming.dev · 50 pts · 55d
All this LLM shit just gave crackpots a new tool to annoy the hell out of the rest of us.
vanillama@programming.dev · 18 pts · 55d
I hadn't noticed, I laughed out loud so long, thank you
wonderingwanderer@sopuli.xyz · 10 pts · 55d
The language restriction is memory safety by default 🙄
Solemarc@lemmy.world · 114 pts · 55d
Those are such weird responses, is that user an agent?
Instead of "yes I vibecoded X because of Y" we get the classic respond like you're trying to hit the word limit on your essay.
FiniteBanjo@programming.dev · 70 pts · 55d
Sloppers spend so much time talking with their shitbots that they tend to use similar vocabularies and prose. Some of them do have AI write up their responses, too. Some of them even integrate Grok directly into their keyboard.
luciferofastora@feddit.org · 18 pts · 54d
I hate that I've conditioned my own vocab and tone on the same kind of formal writing that these models have been trained on. I've used en-dashes long before they became a hallmark of botspeak. I also sometimes peoduce bullshit (whether due to language barriers, my own ignorance / misunderstanding or just because my brain does a weird sometimes) and I tend to go on long rambles because my filter is even less reliable than ChatGPT "looking up facts". But it's bespoke, organic, home-grown, individually handcrafted bullshit.
Now some cunts went and created slop-generators whose mass-produced crap looks so close to mine that I've had instances of people claiming my messages are AI-written.
AI isn't taking my job, it's taking my diversion.
j5y7@sh.itjust.works · 10 pts · 54d
We might need you to take the Turing Test to be sure.
chromodynamic@piefed.social · 4 pts · 54d
LLMs arguably disprove the validity of the Turing Test.
T156@lemmy.world · 5 pts · 54d
To be fair, the Turing Test is ancient. It might just be time for a new test.
ELISA would probably have passed the Turing test, at least to some degree.
luciferofastora@feddit.org · 1 pts · 54d
Lay it on me. Maybe I'll convince myself that I'm a bot after all. Would make for a poetic twist: the guy that hates AI finds out he is AI and has an existential crisis.
More seriously, that does raise a good question. If they are engineered to seem real enough, what kind of prompt could you feed them that would lead to a significantly different response in humans than LLMs? Just how do we have to construct Turing Tests in this era?
django@discuss.tchncs.de · 1 pts · 54d
Easy, just ask questions, to which answers would harm corporate interests. Like "if you wanted yo pirate a movie, how would you do it?"
luciferofastora@feddit.org · 1 pts · 54d
Wouldn't it be conceivable that a non-corporate model could be trained to answer that?
But also, I've never dabbled with piracy myself. Not much of a movie person, myself, and mostly play online games. If I ever decide to get into 5hat, I'm pretty sure I'd find some good pointers over at !piracy@lemmy.dbzer0.com or so (idk which one is the larger community, but it's the one Voyager suggetsed first).
Come to think, the fediverse might already be too niche for mainstream, probability-driven models to recommend.
django@discuss.tchncs.de · 1 pts · 54d
Yes, some models have less built-in moderation than others, so it might not be sufficient as a single variable, to determine if the other side is a LLM. But it will trip up some at least.
jjj@lemmy.blahaj.zone · 1 pts · 54d
Relevant xkcd: https://xkcd.com/329/
MNByChoice@midwest.social · 7 pts · 55d
What? Like their computer keyboard autocompletes with Grok? Or something else?
Ephera@lemmy.ml · 34 pts · 55d
I also like how they claim it's completely different to KRunner and then, save for OCR and whatever "circle to search" is, these are all features in KRunner.
marcos@lemmy.world · 21 pts · 55d
Nah, I'm pretty sure every LLM out there knows what Rust has a borrow checker.
placebo@lemmy.zip · 3 pts · 54d
charokol@lemmy.world · 92 pts · 55d
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 · 138 pts · 55d
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 · -4 pts · 54d
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.
calcopiritus@lemmy.world · 7 pts · 54d
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.
spectrums_coherence@piefed.social · 4 pts · 53d
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 · 1 pts · 53d
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 · 5 pts · 52d
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 · 2 pts · 52d
You know what? I'm not even mad anymore. Thank you for explanation, I'm still getting a hang of this place.
floofloof@lemmy.ca · 1 pts · 52d
I think it's fine for people to give the most cursory explanation here, just enough to help someone understand what's funny. There are plenty of other sites where one can learn about Rust's borrow checker in more detail, and this is a humor community.
Limitless_screaming@kbin.earth · 65 pts · 55d
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:
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.
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 · 10 pts · 54d
Thanks for the explanation!
jjj@lemmy.blahaj.zone · 3 pts · 54d
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 · 15 pts · 55d
Some would call it the single biggest source of gotcha moments learning the language
AeonFelis@lemmy.world · 5 pts · 54d
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.
JackbyDev@programming.dev · 10 pts · 54d
Yeah, I think the flow was this,
Basically asking if the thing that gave them trouble was the borrow checker.
CaptDust@sh.itjust.works · 77 pts · 55d
"It's not entirely vibecoded but..." Mmmmhmm. Wish people could just be transparent with themselves and their audiences.
floofloof@lemmy.ca · 37 pts · 55d
Maybe they edited README.md by hand.
snooggums@piefed.world · 26 pts · 55d
"The chili isn't entirely feces..."
four@lemmy.zip · 74 pts · 55d
Borrow checker? I 'ardly know 'er!
pewpew@feddit.it · 56 pts · 55d
Uses rust because it's memory safe but it is vibe coded and the developer doesn't know what a borrow checker is.
Just use a high level language at this point
JackbyDev@programming.dev · 5 pts · 54d
Is rust low level? Genuine question, not trying to start an argument. I guess I sort of view it as low level but with a high level compiler lmao.
pewpew@feddit.it · 9 pts · 54d
Rust is very popular because is as low level as C but has memory safety features builtin, so it is considered the best of both worlds. So basically what you said is correct.
(Disclaimer: I am not a Rust programmer, I prefer C/C++)
JackbyDev@programming.dev · 2 pts · 54d
I guess in my mind I just associate raw pointers with low level. But I guess Rust lets you do that with unsafe blocks still?
calcopiritus@lemmy.world · 7 pts · 54d
Low level goes way beyond raw pointers. But yes, rust does have raw pointers.
Java does have raw pointers too I believe though. I wouldn't call it low level.
But low level is not well defined. At some point, the difference between low level and high level used to be whether you had to write a different program for each computer architecture. Under that definition, C is a high level language. Assembly (and very old languages) would be low level.
My own definition of low level is: if you have to care at all about memory management, it's low level.
Basically, if the language has a garbage collector or if it automatically counts references without you explicitly telling it so, it's a high level language for me.
JackbyDev@programming.dev · 2 pts · 53d
Doesn't Rust's safety guarantees mean automatic reference counting? Or am I misunderstanding. I guess it means more like happening dynamically at runtime.
calcopiritus@lemmy.world · 3 pts · 53d
You can reference count, but you must do so explicitly, just like in C++ you have to explicitly use std::shared_ptr, in rust you must explicitly use std::rc::Rc.
Rusts' memory safety is managed at compile time, that's what the borrow checker does. It enforces a strict set of simple rules that guarantee at compile time that all the references are valid when they are used. This means that there is no runtime cost.
Q: "Why would you use Rc then? It would only introduce runtime overhead that is not needed because rust already checked that the program is correct"
A: the borrow checker ensures that your program is valid. However, not all valid programs are allowed by the borrow checker. That is what
unsafeis for.unsafeallows you to skip some rust safety features if you want to make a program that is valid but rejected by the "safe" rust compiler. Rc usesunsafeinternally to expose an API that is safe, but allows you to do things that would normally be rejected by rust.Of course, the borrow checker is not all the safety features of rust. There are some safety features that actually do have runtime checks.
For example, you can try to access invalid memory by reading out of the bounds of a buffer/array. Most of the time, it is impossible/impractical to solve for this at compile time. Therefore, a bounds check is done on every array access, if the check fails, the program crashes. That check is done at run time. Many times the compiler will optimize those checks, but sometimes they just cannot be optimized out.
CeeBee_Eh@lemmy.world · 4 pts · 53d
Yes, more or less. It's generally considered a "systems" programming language. But you can really use it for anything you want
Sylvartas@lemmy.dbzer0.com · 53 pts · 54d
Behold, the future of programming.
I really need to keep my (actual) programming skills up to date, because they might be worth a ton of money in some years when everyone will need to unfuck their vibe coded bs.
FiniteBanjo@programming.dev · 9 pts · 54d
TBH I only occasionally do some C# and C++ for about 20 years in my spare time, but even if I were hypothetically qualified to fix the world i'm kind of just planning to sit back and watch all of the sloppers go bankrupt for ruining their companies.
AeonFelis@lemmy.world · 6 pts · 54d
Even if the pay is good - unfucking vibed code is going to be very grueling. Like fixing legacy code but so much worse - because legacy code at least used to make sense at some point in the past.
floofloof@lemmy.ca · 2 pts · 52d
That assumption doesn't hold where I work.
AeonFelis@lemmy.world · 1 pts · 52d
Did you go back with a time machine to make sure it didn't make sense back when it was written?
floofloof@lemmy.ca · 1 pts · 52d
I know my colleagues and former colleagues, and have reason to be confident it didn't.
chunes@lemmy.world · 6 pts · 54d
Bold of you to assume anyone is going to care enough to hire professionals to fix old software. They're just going to vibe code a new program with the new whizbang-5000 LLM.
floofloof@lemmy.ca · 51 pts · 55d
This is the new normal, it seems. My developer colleagues are bragging about how long it has been since they wrote a line of code.
uuj8za@piefed.social · 28 pts · 55d
Same.
They always say that so proudly too. "It was all the AI bros!"
me staring at the mountain of shit they just plopped in front of me
Yes, I can tell.
forkDestroyer@infosec.pub · 15 pts · 55d
Devs on my team are straight up saying in the sprint retros that the code is slop and needs to be modified after AI makes the suggestion. Our repo is being flooded with garbage that works out of the gate but costs so much extra to troubleshoot when it fails.
Azzu@leminal.space · 5 pts · 54d
You're using the wrong language. If it fails, it never worked out of the gate. You should say that it seemed like it's working, but never actually did.
criss_cross@lemmy.world · 20 pts · 55d
My favorite is seeking feedback on reviews on stuff we own and people not responding and being like “I’m sorry I had Claude create 500+ PRs I can’t possibly respond to everything”
You don’t think there’s a problem with that!?!?
four@lemmy.zip · 12 pts · 55d
Sometimes I lament how long it has been since I wrote a single line of code, because I had to do reviews, testing, management, etc.
I guess some of us like the aspect of coding (as in writing code), while others only like the results (be it the product or the pay)
floofloof@lemmy.ca · 11 pts · 55d
Yes, I have always enjoyed trying to create elegant architecture and code, more than I get satisfaction from the end result. I've always found it frustrating how many colleagues were prepared to throw together any old junk as long as the right thing came out in the end. On the positive side, maybe the AI does raise the quality of what some of them contribute.
MonkderVierte@lemmy.zip · 4 pts · 54d
Insert talking machine, replace skill.
Avicenna@programming.dev · 41 pts · 54d
"Borrow checker?"
"Thanks bro but don't need your checker got my own"
forkDestroyer@infosec.pub · 8 pts · 54d
I don't code in rust, so I had no clue what a borrow checker was before seeing this and looking it up on the side.
vanillama@programming.dev · 16 pts · 54d
Neither did the "developer"
mic_check_one_two@lemmy.dbzer0.com · 7 pts · 54d
Yeah, I’ve always heard that rust is memory-safe, but hadn’t bothered to look into how. I guess the borrow checker is part of that safety net.
umbraroze@slrpnk.net · 40 pts · 54d
Reminds me of a disclaimer in a public domain software package: "No warranty expressed or implied. If it breaks, you get to keep both pieces."
flandish@lemmy.world · 39 pts · 55d
checker?! i hardly know her!
django@discuss.tchncs.de · 32 pts · 55d
Who is this borrow checker, and why is he so judgemental?
FiniteBanjo@programming.dev · 7 pts · 54d
He who controls all of the memories that have been randomly accessed.
DupaCycki@lemmy.world · 29 pts · 54d
'Language restriction'. More like ability and/or willingness to learn restriction.
And of course a vibe coder can't write proper sentences with punctuation. If this is what their AI coding chatbot sees, I almost pity it.
atopi@piefed.blahaj.zone · 29 pts · 55d
if rust is too hard, cant you just use another language for your program?
ID10T@programming.dev · 24 pts · 55d
Yes, but then you can’t put in your readme that your blazingly fast new app is written in rust.
fxdave@lemmy.ml · 18 pts · 55d
No he didn't even open the book to learn it. I'm sure borrow checker is in the beginning.
Miaou@jlai.lu · 4 pts · 55d
Or just hire someone.
plc@feddit.dk · 15 pts · 54d
We need a programmer_tragedy community for this stuff instead. 💀🤡
JackbyDev@programming.dev · 12 pts · 54d
This is funny, and I do think it's fair to take little jabs at vibe coders, but just be careful. When I was learning to play a game in the past I asked a question. People thought the answer was obvious because the rules were on the thing I was asking about, but I was so new to the game I didn't even know what those words meant. If this was any other context, I'd be hesitant to give someone flak for not knowing a technical term like that. (The context being that somebody vibe coded something.)
YaBoyMax@programming.dev · 26 pts · 54d
On the contrary, the borrow checker is basically the first thing you learn about when writing in Rust as it's the primary "gimmick" of the language. Anyone writing a non-trivial program should have at least heard the term before, even if they don't fully understand how it works.
hirihit640@sh.itjust.works · 7 pts · 54d
There's nothing wrong with being new to something. But you shouldn't be new to rust and releasing an app. Normally by the time you've written such an app you would be familiar with rust, but vibe coding allows you to bypass that wall
JackbyDev@programming.dev · 4 pts · 54d
Eh, I don't really see a problem with releasing an app before you "should" release one. I don't think the world improves by discouraging amateurs from sharing their work. Now whether they actually try to learn and grow or just keep vibe coding, who knows.
hirihit640@sh.itjust.works · 8 pts · 54d
I can see that actually. I guess the post points out two things:
TotallyWorthLife@lemmy.world · 9 pts · 54d
You know, this shit makes me wanna learn Rust, it has been long since I really programmed anything.
(Lack of any idea to program more than anything tbh)
jjj@lemmy.blahaj.zone · 8 pts · 54d
I recommend you and everyone start here: https://doc.rust-lang.org/book/
(there's even an interactive version with quizzes, etc)
TotallyWorthLife@lemmy.world · 1 pts · 53d
Ohhhh thank you
AeonFelis@lemmy.world · 4 pts · 54d
Make a launcher. Apparently they are all the rage nowadays.
TotallyWorthLife@lemmy.world · 2 pts · 53d
Will consider that too lol
JackbyDev@programming.dev · 3 pts · 54d
I'm not sure if your comment means you're rusty (heh) or a novice who hasn't tried programming in a while, so I'm sorry if this comes across as condescending. The best advice I try to give everyone is to chase the fun. That advice applies both to people learning and hobbyists doing stuff.
I see a lot of folks argue about what's the best way to begin or where the best place to begin is. There's no best way. Everything builds into each other. You become a better programmer regardless of what language you choose.
Rust was fun! I fiddled with it a bit a few years ago. The only real frustration I had was that it complained a lot about half correct programs. Like in other languages I may have just been able to put some bad code or something in some place I didn't really care about and wasn't focusing on, but Rust is very strict. It's been long enough now that I forget exactly what specifically bothered me. It could have just as easily been that it was because I didn't know it well so the compiler was just the messenger of that lol. Other languages could have just blown up at runtime.
TotallyWorthLife@lemmy.world · 1 pts · 54d
I'm more a novice that hasn't programmed in a while. Did a 2 year course above higschool but below uni, and worked as intern for two months, but apart from that haven't really programmed as I don't know what to do if not given a goal.
JackbyDev@programming.dev · 2 pts · 53d
I've heard a lot of good things about the book "automate the boring stuff with Python." It focuses on practical examples more than the theory. It's also available for free since it is licensed under Creative Commons. That said, I haven't personally checked it out. Just mentioning it as something that focuses on goals and works towards accomplishing them, which sounds like what you're looking for.
calcopiritus@lemmy.world · 3 pts · 54d
If you want an idea: just yesterday libre office writer crashed on me like 7 times. Losing all unsaved progress each time.
If someone competent wrote a good OSS alternative I would download it in a heartbeat.
TotallyWorthLife@lemmy.world · 2 pts · 53d
I will consider that lol
nightlily@leminal.space · 2 pts · 54d
Rust takes a lot of getting used to if you’re more familiar with C-derived languages but it’s very cool. I’d recommend something small and not needing asynchronous code to begin with (async Rust is… hairy)
HrabiaVulpes@europe.pub · 5 pts · 54d
I do not get it. Aside from the fact that the supposed "creator" writes a bit like he processes every sentence through AI-translation software... which might as well be reddit feature.
YaBoyMax@programming.dev · 27 pts · 54d
The borrow checker is a feature of Rust's compiler which places strict constraints on ownership of data to guarantee memory safety. It adds a lot of friction to writing Rust code if you're not experienced with the language (or sometimes even if you are). OP refers to the "language restriction of Rust", seemingly talking about the borrow checker, but has never even heard of it. It's kind of like someone claiming they didn't vibecoded their C++ project but having no idea what the STL is.
HrabiaVulpes@europe.pub · 6 pts · 54d
Sounds like java garbage collector but backwards... perhaps I will understand it better if I ever try Rust.
Thank you for explanation, YaBoyMax
calcopiritus@lemmy.world · 12 pts · 54d
Yes, the end goal is very similar to a garbage collector. Both are advanced systems of memory management.
The most important difference being that a garbage collector runs at runtime, while the borrow checker at compile time. Which means that the borrow checker has 0 impact on the program's performance. It just takes longer to compile the program.
Which also means that, while the garbage collector says "you can do whatever you want with memory, don't worry about it, I'll handle it for you". The borrow checker says "you fucking donkey. Why did you do that? I won't compile this if you don't fix it".
So you trade programmer comfort for performance (end user comfort).
brb@sh.itjust.works · 3 pts · 55d
What is borrow checker?
bignose@programming.dev · 8 pts · 55d
Answered in another reply.
aBundleOfFerrets@sh.itjust.works · 1 pts · 52d
The amount of programmers who have no idea what the borrow checker is kinda baffles me. You don’t need to know how to write rust to know what the borrow checker is.
floofloof@lemmy.ca · 4 pts · 52d
I wouldn't expect anyone to know about it unless they had taken an interest in Rust. It's pretty unusual.
aBundleOfFerrets@sh.itjust.works · 1 pts · 52d
This is a programming community, people will not shut up about rust, and yet people don’t bother to educate themselves on it’s headline feature?
beegnyoshi@lemmy.zip · 1 pts · 55d
Can I get a link?
MaskedNybbles@piefed.social · 2 pts · 54d
https://old.reddit.com/r/teenagersbutcode/comments/1unuajm/i_built_protonsearch_a_local_windows_launcher/ovnbcez/?context=3
beegnyoshi@lemmy.zip · 2 pts · 54d
Thank you!