5 ms·
Is this because of memory bugs\vulnerabilities that target the stack or just because it was too old and junky?
by CyberRage 6y ago
Is this because of memory bugs\vulnerabilities that target the stack or just because it was too old and junky?
- pas 6y agoJunkiness and vulnerabilities go hand in hand.
- CyberRage 6y agoTrue that. maybe I'll rephrase, was Rust specifically chosen to address memory concerns? I don't think it is too common in Android.
- nynx 6y agoThat's probably a major reason. But, Rust is also just a really nice language that's very pleasant to use.
- stusmall 6y agoI did a quick look on androidxref and saw a lot more .rs files than I expected. I haven't worked in Android frameworks stuff since around 5.0. I knew not too long after I left that world they started adding some minimal rust stuff, but looks like its grown a bit. Exciting. It's a perfect fit.
- mamcx 6y ago> I don't think it is too common in Android. ??? Android crash little things left and right, and have leaks just for existing.
- est31 6y agoDunno what motivated them internally, but the bluetooth vulns that made news in Feb 2020 would have been prevented by safe Rust. See my comment from back then: https://news.ycombinator.com/item?id=22265572 https://news.ycombinator.com/item?id=22265572 According to dtolnay, there are only 4 lines of unsafe rust in the Rust component. It's a bit small though at the current moment in time, with 4 thousand lines. Most of the code is still C++. Note that it's "with Rust" in the headline, not "in Rust".
- mamcx 6y agoAlso, a strong point of Rust is just the way the types and the defaults are. Most people think the borrow checker is the only major thing, but Rust have this features: * Plain Structs * Rich enums (aka: Algebraic types) that leads to * All replacements to nulls (Option, Result, Default(trait), Empty(idiom)) * Immutability and functional style as preferred when sensible * Consistency in APIs by proxy of traits (all conversions going with Into/From traits, All iterables can .collect into all containers, etc) and many things like this that make very productive to build good APIs when you get the handle of it.