7 ms·
Rust compiler added to Android tree
- mtgx 7y agoMicrosoft is also considering it for some Windows components as 70% of Windows bugs are memory-related: https://msrc-blog.microsoft.com/2019/07/16/a-proactive-approach-to-more-secure-code/ https://msrc-blog.microsoft.com/2019/07/16/a-proactive-appro... I wonder if Google is adding support, because it's also considering replacing the OpenSSL-forked BoringSSL with the Rustls crypto library: https://news.ycombinator.com/item?id=20480277 https://news.ycombinator.com/item?id=20480277 That would be pretty cool, although I wonder if they shouldn't opt for a Noise Rust library instead: https://github.com/mcginty/snow https://github.com/mcginty/snow
- _bxg1 7y agoCan someone familiar with the Android ecosystem elaborate on what exactly this means? Does it mean you get rustc automatically when you download the Android SDK? Does it imply any particular level of support? How many other languages have this status?
- blaisio 7y agoThis happens a lot on hackernews, and frankly it's really annoying. People post a link to some random thing like this, and it gets upvoted because people don't click on the link, they just are excited about the title. A lot of times, the title doesn't even mean anything. Hackernews != Twitter. </grumpy> I'm going to get some more coffee.
- _bxg1 7y agoI mean, it sounds like it means something, it's just hard to understand without some context.
- tosh 7y agohn is one of the few places on the web with a community that notices changes like these and that can contextualize them just-in-time.
- cpeterso 7y agoHN could reduce (but not prevent) upvoting of unread articles by removing the upvote button from the HN home page (so you can only vote after having opened the HN thread page and seen some comments) and/or requiring the user to click the article link before the upvote button appears (so the user might have read the article before voting).
- ndesaulniers 7y agoI'm just here for the sweet fake internet points. Let me know if you find out where I can redeem them...
- crispinb 7y agoI've always taken it for granted that the voting system is essentially meaningless, especially for comments, so don't generally use it (I'll downvote egregiously rude or idiotic comments, but that's it).
- skybrian 7y agoIt means someone working on Android needs to compile something written in Rust badly enough to add support for it. The second Android developer needing to use Rust will presumably have an easier time of it, but how much Android will really use it is speculative.
- _bxg1 7y agoMeaning Rust is being used in the Android OS itself, so this isn't about app developers?
- skybrian 7y agoWe don't know what it's for. It might be used in a sample app. But it's not something ordinary Android developers need to pay attention to.
- kllrnohj 7y agoCorrect. But nothing stops you from using rust today as an app developer. See https://docs.rs/crate/cargo-ndk/0.2.0 https://docs.rs/crate/cargo-ndk/0.2.0
- stefano 7y agoDoes anyone here have experience on using Rust for shared business logic between Android and iOS? It's something I'm considering but it seems there isn't a lot of documentation around it.
- j0hnnybravO 7y agoCurrently you could use kotlin/native for such effort.
- dbrgn 7y agoFor iOS, you create C FFI bindings for your lib. Then you conpile a universal binary with cargo-lipo and use it from Swift like a C library. For Android you write JNI bindings with something like rust-jni. So yes, you have to write bindings twice. For an example project check out https://github.com/dbrgn/candidateparser https://github.com/dbrgn/candidateparser and https://www.reddit.com/r/rust/comments/7aam04/meetup_slides_calling_rust_from_c_and_java/ https://www.reddit.com/r/rust/comments/7aam04/meetup_slides_...
- kllrnohj 7y ago> Can someone familiar with the Android ecosystem elaborate on what exactly this means? It means that Google is experimenting with using Rust to build parts of Android. That could mean parts of the OS, tests, tools, SDK, etc... As a simple example of why this isn't necessarily super interesting is Python has been in the Android tree for ages, but just for some build & test stuff. But maybe it's interesting just in that the Google engineers working on Android have started playing with Rust enough to bother checking it in to the tree.
- _bxg1 7y agoCool; so it's not an app development thing, it's an OS thing. Thanks for the explanation.
- libria 7y agoSomeone at Google should check in a Bitcoin hashcash library into the tree and watch HN go wild.
- swsieber 7y agoOne reason I find this interesting however is that fuchsia, a potential replacement for Android being worked on at google (that's an aggressive oversimplification) is partially written in Rust. So this potentially opens up using parts of fuchsia.
- panpanna 7y agoI think they want to experiment rewriting some libraries in Rust to avoid things like stagefright in future. Pretty much what Mozilla did when Rust got more serious.
- mmastrac 7y agoPretty wild how many tools are required to get a hermetic Android build: https://android.googlesource.com/toolchain/ https://android.googlesource.com/toolchain/ edit: this just means that Android developers can now include Rust-language components in Android itself.
- matthewbauer 7y agoI don't think these are all necessarily required. At least I would be very very surprised if both avr-libc, mingw, and go were needed.
- mmastrac 7y agoFor avr-libc, probably this: http://tool.oschina.net/uploads/apidocs/android/guide/topics/usb/adk.html http://tool.oschina.net/uploads/apidocs/android/guide/topics... Unsure about mingw/go, but they are likely deps for some Android ecosystem project.
- jsty 7y agoLooks like go is mostly used in a graphics package (platform_external_skia): https://github.com/search?utf8=%E2%9C%93&q=org%3Aaosp-mirror+language%3AGo&type=Code&ref=advsearch&l=Go&l= https://github.com/search?utf8=%E2%9C%93&q=org%3Aaosp-mirror...
- stusmall 7y agoIt's been something like 3 years since I've worked in AOSP but IIRC mingw is for windows builds of adb. Someone else called out that AVR stuff is for ADK. The Android build tree is more than Android itself. It also builds includes a lot of the supporting tools and libraries for developers.
- ndesaulniers 7y agoFWIW things may not actually be used anymore, doesn't mean the repo is ever taken down. Usually the manifests that sync these repo's simply "unhook" the repos when they're no longer in use. OP is excited that there's a bunch of links, but that's not the correct measure of "in use."
- milky2028 7y agoIt's not too farfetched to think that some Rust code might be used in Android itself. Google already uses Rust in ChromeOS to build the Linux VM.
- deleted 7y ago[deleted]
- summerlight 7y ago1. A large fraction of Garnet (low level components of Fuchsia) is written in Rust. (https://fuchsia.googlesource.com/fuchsia/+/refs/heads/master/garnet/public/rust/ https://fuchsia.googlesource.com/fuchsia/+/refs/heads/master...) 2. Fuchsia seemingly supports Android apps (https://9to5google.com/2019/01/02/android-runtime-app-support-fuchsia/ https://9to5google.com/2019/01/02/android-runtime-app-suppor...). 3. For 1 + 2, Android may need to include and compile a part of Fuchsia for interop. My guess is that this addition is mostly for supporting Fuchsia, rather than using Rust directly in Android.
- smitty1e 7y agoRusty 'Droids: no longer strictly a Star Wars thing.