logoalt Hacker News

fao_yesterday at 9:23 PM3 repliesview on HN

[flagged]


Replies

dralleyyesterday at 11:03 PM

Not really though. That's like saying that no language is "safe" because the compiler could have a bug.

It's true that safe wrappers around unsafe code sometimes have bugs in them, but it's orders of magnitude easier to get the abstraction right once than to use unsafe correctly in many places sprawled across a large codebase.

IshKebabyesterday at 9:45 PM

It's not as simple as that. All software is abstraction and with any software if you go deep enough you'll find unsafe code.

E.g. look at a Python list. Is it safe? In Python sure, but that's abstracting a C implementation which definitely isn't safe.

If you look at Rust's std::Vec you'll find a very similar story - safe interface over an unsafe implementation.

It isn't as binary as you think.

paulddraperyesterday at 9:58 PM

If you don’t see any difference between those two, I’m really not sure what to say.