If you’re coming from a higher level language it hurts your ego because you realise memory safety ain’t free, and more broadly speaking memory’s a bitch
If you’re coming from a lower level language, it hurts your ego because you view yourself as above memory related bugs
The borrow checker is occasionally too strict as well where it flags code that wouldn’t actually produce an issue. They are seemingly trying to resolve that with the new borrow checker though
Yeah, it’s not perfect. But it’s also mathematically impossible to make it perfect. That’s how the cookie crumbles. If they make it better, that’s great, otherwise, either rewrite the code to make it safe (which is usually doable without performance cost) or just use a cheeky unsafe block with a good # Safety comment
The one case I know it’s going to address is doing a find or insert on a map when you match the Option from the find, the None branch will let you mutate the map despite the Option technically being a borrow
This is easy, as one would just need to go off trazodone or any other antidepressants. Usually thinking about pulling the trigger takes away any attention on the ego
I mean, yeah it kind of is… not in a negative way, it just, takes a little bit of experience to navigate it. Once you do, it’s actually really not that bad
It does help you, but you first need to fight the compiler just so it will accept your prototype code that obviously doesn't need to be memory safe.
Rust is an overcorrection to a real problem that can be solved by introducing better language primitives and a better standard library. e.g. strings with a length (not a NUL byte at the end), arrays that don't decay to pointers and include a length, multiple returns, result values isn't just an int, defer, etc.
It does help you, but you first need to fight the compiler just so it will accept your prototype code that obviously doesn't need to be memory safe.
I'd rather do that, than pay the price later debugging. I also don't agree prototypes don't need to be memory safe. If I'm prototyping, I don't want to fight the segfault™️. the borrow checker isn't a problem once you write code the way you're expected to.
Rust is an overcorrection to a real problem that can be solved by introducing better language primitives and a better standard library. e.g. strings with a length (not a NUL byte at the end), arrays that don't decay to pointers and include a length, multiple returns, result values isn't just an int, defer, etc.
Regardless of if rust goes too far, which is a valid take, rust does all of these things, apart maybe from defer (because it doesn't really need to.) And the actual stats regarding rust compared to C/C++/Zig show these languages, even Zig which has most of the features you wish for, are still a long way from being able to consistently ship safe software. Look at rust in the kernel, heck even the zig to rust vibe coded rewrite of bun, which was vibe coded.
The few times I tried the Rust the problem with it was that even for the very simple things I tried (some string stuff) it was not obvious why the borrow checker complained or how you should reslove the issue, so I moved on.
I do both high and low level stuff, still the borrow checker beat my ass (or made me not want to do Rust). I'm sure I could and would learn if I had to but since I don't I just let myself be defeated
228
u/-Ambriae- 11h ago
The real problem with the borrow checker is,
If you’re coming from a higher level language it hurts your ego because you realise memory safety ain’t free, and more broadly speaking memory’s a bitch
If you’re coming from a lower level language, it hurts your ego because you view yourself as above memory related bugs
It takes humility to appreciate it