Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Is this because of memory bugs\vulnerabilities that target the stack or just because it was too old and junky?


Also, 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.


Dunno 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

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".


Junkiness and vulnerabilities go hand in hand.


True that. maybe I'll rephrase, was Rust specifically chosen to address memory concerns? I don't think it is too common in Android.


> I don't think it is too common in Android.

??? Android crash little things left and right, and have leaks just for existing.


I 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.


That's probably a major reason. But, Rust is also just a really nice language that's very pleasant to use.




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

Search: