this post was submitted on 03 Jul 2023
154 points (97.0% liked)

Programmer Humor

19817 readers
122 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 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 12 points 1 year ago (1 children)

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 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.