Hacker News new | past | comments | ask | show | jobs | submit login
Memory Unsafety in Apple's Operating Systems (langui.sh)
14 points by reaperhulk 80 days ago | hide | past | web | favorite | 5 comments

This is great, and pretty damning evidence of traditional, unsafe languages.

Do we have any data on how much of iOS is implemented in unsafe code vs in macOS? In particular, I want to know if the difference in memory safety ratio correlates with a language choice ratio. I don’t think sufficient information to make that determination is public, but I would love to be wrong about that.

(I guess one of the problems with that measurement would be is that it’s hard to tell if an ObjectiveC file has parts of straight C in it, which you’d expect more of in system code.)

As far as we know the entire kernel for both is memory unsafe.

It's not clear to me how much Swift is in use internally for things besides apps (e.g. is there a future where Window Server is Swift?)

You can also compare the valgrind suppression files for the various versions of darwin, vs Linux glibc known vulnerabilies, mostly memory leaks. Darwin is just horrible. Even if it just copied Freebsd's libc, it managed to add so many mistakes with everything they touched. glibc is mostly fine

> Yes, of course migration is difficult! Any company doing it will need to retrain people, make toolchain changes, and undoubtedly invest in improving both the compiler and language itself. If only there was some enormous company with vast resources and a commitment to privacy and security who could embark on a journey like this…

You mean Swift?

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact