this post was submitted on 22 Jul 2025
425 points (98.2% liked)

Programmer Humor

25228 readers
602 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
 

I don't think that casting a range of bits as some other arbitrary type "is a bug nobody sees coming".

C++ compilers also warn you that this is likely an issue and will fail to compile if configured to do so. But it will let you do it if you really want to.

That's why I love C++

you are viewing a single comment's thread
view the rest of the comments
[–] Speiser0@feddit.org 12 points 3 days ago (1 children)

You don't even need unsafe, you can just take user input and execute it in a shell and rust will let you do it. Totally insecure!

[–] ignotum@lemmy.world 13 points 2 days ago (1 children)

Rust isn't memory safe because you can invoke another program that isn't memory safe?

[–] Speiser0@feddit.org 8 points 2 days ago

My comment is sarcastic, obviously. The argument Kairos gave is similar to this. You can still introduce vulnerabilities. The issue is normally that you introduce them accidentally. Rust gives you safety, but does not put your code into a sandbox. It looked to me like they weren't aware of this difference.