Live data from Hacker News

Bare-metal Rust in Android

security.googleblog.com

101–110 of 124 posts

Re: Bare-metal Rust in Android

#103
post #92
post #91

Earlier quoted context omitted.

I did a lot of cross platform development work from 1982 onwards and 1987 was very much the year of C for Intel | DOS machines - they were cheap (comparitively), widely available and Borlands Turbo C was a fully integrated IDE that was affordable (and|or pirated) with some outstanding manuals. Between that and their ASM for low level work, C took off in a big way and Pascal sharply dwindled in popularity (although it…

In Europe, in a MS-DOS world without cross-platform considerations, it took until Windows 3.x release, and Watcom C++ with its DOS extender for folks to really care about C and C++. In fact, we used Turbo C 2.0 to prepare our code samples to deploy them into a single Xenix computer shared across the whole school, and that was it, nothing else.

Watcom was a much much better compiler and was welcomed with open arms to be sure - I still have a copy of the last release and use it on occassions.

If we're waxing historic here, my first C compiler (of my own and not a university VAX | PDP version) was the Cain | Hendrix Small C compiler (released 1980) which I handcopied in 1982 and extended over the next year or three as I read the Dragon books and other works .. bit of a side exercise while doing an engineering degree and working on a sheep shearing robot.

Thank-you Dr. Dobb's Journal of Computer Calisthenics & Orthodontia

https://en.wikipedia.org/wiki/Small-C

Re: Bare-metal Rust in Android

#104

Earlier quoted context omitted.

People want to replace C, which runs anywhere. Rust must also be able to.

Rust is a replacement for C++; if you look for a C replacement you should look on Zig

Pity that it is as good as C in producing UAF exploits, and doesn't have any story for binary libraries.

Re: Bare-metal Rust in Android

#105

Earlier quoted context omitted.

It's incredibly fast compared to most programming languages.

I think Java was much faster. Rust is 8 years old and is still not fully stable (you need nightly for a lot of projects). Projects are planning and adding support but not many are actually using it yet. Java was the hotest thing on the job market after only 3-4 years.

Your reasoning is not quite correct (rust’s nightly has no relevance here), but you are right in that Java seen an unprecedented growth, and probably no other language will ever demonstrate anything like that due to the “market” being so saturated since. Even if it would be the silver bullet language.

Re: Bare-metal Rust in Android

#106

I may have wrong assumptions, but I find it funny they didn't use Golang. Is it not capable of doing the same thing ? Anyway, happy to see rust being adopted for that usage.

Go is not a low-level language. They already have Java which sits at the exact same level.

Re: Bare-metal Rust in Android

#107
post #60

Earlier quoted context omitted.

Or dead pointers used, or race conditions

Nope. Race conditions are an ordinary fact about our universe, Rust has those. (Safe) Rust doesn't have data races which are much stranger. Race conditions are just an ordinary effect where several actors are doing things and you need to be careful to ensure that they're co-ordinated properly if that's important. If Alice and Bob both conclude there's no milk, both then go to the store and buy milk, now there is too…

Just to add: OCaml also recently introduced a new memory model which promises that data races can only corrupt a bounded part of the program (basically, even stronger guarantees than Java does). It comes with some runtime overhead, but quite interesting development, you might find worthwhile to check out.

Re: Bare-metal Rust in Android

#108
post #74

Earlier quoted context omitted.

I wasn't around for it, but didn't C grow fast during the 70s and 80s? And didn't Java and JavaScript also spread pretty fast? Of course, Java was explicitly promoted and advertised by Sun, and JavaScript played off of Java's popularity and later became a web standard.

C was definitely a player in the 70s and 80s (when it (and Unix) still had a lot of healthy competition), but it didn't attain its current veneer of ubiquity until approximately the early 90s (after being standardized in 1989). Javascript was derided as a joke until 2009 brought ECMAScript 5 and Node.js. Java's rise was relatively fast, but Java also had the benefit of the most concerted corporate ad campaign in the…

Regarding Java, it also helped that big Smalltalk players like IBM, decided to fully pivot into Java, and many Oracle haters might not realise that alongside IBM, they were the first ones to have alternative JVMs and were together with Sun in the Network Computer effort.

Smalltalk had a .NET like role in OS/2, one of the reasons SOM even supported metaclasses, just imagine the alternative universe.

Re: Bare-metal Rust in Android

#109

Earlier quoted context omitted.

Tell me you've never done any Android development, without telling me... This is such a low-effort "take" without any effort to justify _why_ you'd want something like this. There's a high amount of impedance mismatch trying to write GUIs in a non-GC language like Rust which _has_ to run on what's essentially a Java VM (ART). At least with a language like Go, it somewhat makes sense, and has been attempted: https://g…

There's a reason Chrome is mostly written in C++. Android's JVM system is a collection of Java wrappers around C++ libraries. There's some overhead in that translation layer, and it's unfortunate that you can't skip it. Even Google's own Flutter uses a C++ engine to run Dart applications. Kotlin (and Java) is fast enough for many applications, but even with the recent advancements in ART, does have overhead compared…

At the same time, GUIs really don’t work nicely/as idiomatically without a GC. Most Rust GUIs do immediate mode only, which is a much more easier problem, and you won’t have to “argue” with the borrow checker constantly. But it would drain the battery of a phone in an hour (it would be the equivalent of running a proper 3D game as your notes app or whatever).

Re: Bare-metal Rust in Android

#110

Earlier quoted context omitted.

Tell me you've never done any Android development, without telling me... This is such a low-effort "take" without any effort to justify _why_ you'd want something like this. There's a high amount of impedance mismatch trying to write GUIs in a non-GC language like Rust which _has_ to run on what's essentially a Java VM (ART). At least with a language like Go, it somewhat makes sense, and has been attempted: https://g…

> There's a high amount of impedance mismatch trying to write GUIs in a non-GC language like Rust Sorry, what does the idea of a user interface have to do with garbage collection? They seem entirely unrelated at first blush, and it's not difficult to find GUI code written in rust.

Immediate mode vs retained mode. It is not a hard requirement, but the borrow checker definitely makes the latter more complex.
Post reply on HN