159
Borrow Checker (programming.dev)
all 12 comments
sorted by: hot top controversial new old
[-] MooseBoys@programming.dev 16 points 1 year ago
[-] Xylight@programming.dev 10 points 1 year ago

best solution to all rust problems /s

[-] henfredemars@lemmy.world 2 points 1 year ago

This might be the wrong place for this question, but I have heard criticism that real rust programs contain lots of unsafe code. Is this true?

[-] Zyansheep@vlemmy.net 11 points 1 year ago

Define what makes a rust program "real" lol.

Any kind of library that does a lot of low-level stuff (kernel syscalls, custom binary reprs, ffi) will have to use unsafe. But most applications built using these libraries rarely need to use unsafe at all, because the libraries act as safe wrappers to make sure the app developer isn't accidentally violating invariants allowed by the "unsafe" keyword.

[-] lightsecond@programming.dev 4 points 1 year ago

Yeah. For example Lemmy backend is written purely in Rust and doesn’t use unsafe anywhere, but some lower-level library it uses probably does use unsafe for IO code.

[-] nothacking@discuss.tchncs.de 2 points 1 year ago

Just use make-static, no unsafety in sight.

[-] SJ_Zero@lemmy.fbxl.net 12 points 1 year ago
this post was submitted on 03 Jul 2023
159 points (100.0% liked)

Programmer Humor

19512 readers
279 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 1 year ago
MODERATORS