r/ProgrammerHumor • • Oct 22 '26

instanceof Trend itsBadIfItsOnlyPHP

Post image
4.5k Upvotes

335 comments sorted by

View all comments

Show parent comment

-3

u/Stunning_Ride_220 Oct 22 '26

Rust still unsafe much in it's core libraries?

3

u/klimmesil Oct 22 '26

The intel ISA is unsafe in essence. That does not mean you cannot build safe abstractions with limited trust on top of it

1

u/Economy-Isopod6348 Oct 22 '26

I'm a rust dev, in practice, unsafe basically never causes vulnerabilities because it's contained, encapsulated behind safe api and there are like 20 different tools/systems in place to protect against vulnerabilities. cargo-geiger, cargo-audit, MIRI, fuzzing, multiple sanitizers. And then rustc has its own safety protocols like killing itself when an invariant fails (although that one is rarely used)

1

u/Great-Powerful-Talia Oct 22 '26 edited Oct 22 '26

Generating and running assembly is inherently memory-unsafe. It's silly to criticize the core libraries for the possibility of memory-unsafe code when you're still trusting the entire compiler, made by the same people, to only produce memory-safe code. Those libraries are practically part of the compilation logic.

0

u/-Redstoneboi- Oct 22 '26

not that much. if there is unsafe, it's usually small and contained. usually.

the application code can then be written without direct use of unsafe, trusting the library to have verified the unsafe blocks.