-33
Rust trojan horse
(thelemmy.club)
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.
"We spent two decades making sure the compiler will never produce memory-unsafe code. It requires a lot of nigh-illegible boilerplate code to even compile and adds massive cognitive load, but the effort will be worth it.
Anyway, here's a type whose only purpose is to disable all of that shit."
Cell doesn't disable memory safety, though? It comes with additional restrictions such as being unable to share between threads (statically enforced) obviously, it's not an unsafe feature. You also can't read from it unless your type can be bitwise copied, etc.
Interior mutability is mostly for making immutable interfaces that for some reason or another benefit from storing a bit of mutable state, such as for lazy evaluation. It's also used for cross thread communication in some cases since you have to use shared (immutable) references to share things between threads.
this is the entire source code for an app that performs a rather complex function, note the absence of boilerplate
from https://codeberg.org/Mycellf/wordjoin