Re:Memory Safe Languages in Android 13
by rob74 on Thursday December 01, 2022 @04:56PM
(#33823469)
...but still, even with Android's importance and Google's resources, they're not planning to "rewrite it in Rust", at least not for now - only new code will use Rust.
[ Parent
| on HN ]
Re:Memory Safe Languages in Android 13
by lolinder on Thursday December 01, 2022 @05:02PM
(#33823563)
The overwhelming majority of bugs of any sort live in new code. The longer a piece of code has been around, the safer it generally is (with occasional high-profile exceptions). This means two things:
1) The most cost-effective way to eliminate the majority of memory bugs is to just start writing all new code in a memory-safe language. If you were going to write new code anyway, you may as well do it safely.
2) Going back and re-writing existing code that doesn't need to be changed may solve latent memory bugs, but it will likely introduce other regressions that could be worse for security or for user experience. If code doesn't need to change, it's often better to leave it as is.
Not that a rewrite is never called for, but it's not necessarily the best course of action by any metric (even when neglecting the cost).
Part of that safety is users working around known bugs, leading to inefficient solutions to whatever the code is supposed to do.
People tend to forget that they don't have to live with those problems, but they still have a cost
Re:Memory Safe Languages in Android 13
by estebank on Thursday December 01, 2022 @05:02PM
(#33823558)
New code includes rewrites, like the Bluetooth stack.
Re:Memory Safe Languages in Android 13
by brundolf on Thursday December 01, 2022 @06:30PM
(#33824579)
Mostly new code. They've rewritten some core, high-importance pieces. But any mature OS is a massive codebase, so it just wouldn't be feasible to systematically rewrite the entire thing indiscriminately