3 ms·
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 tran
by jeroenhd 3y ago
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 to pure native code. I can't think of a reason why the API interaction overhead would pose a problem, but if Google themselves can find use cases for almost JVM-less apps, I'm sure there are reasons to give a Rust version a try.
- izacus 3y ago> Android's JVM system is a collection of Java wrappers around C++ libraries. This isn't even remotely true and it's obvious if you'd ever looked closely at Android. This take is as bizarre as saying that whole web/JS/React ecosystem is "just" wrappers on top of Skia.
- rohandhruva 3y ago> There's a reason Chrome is mostly written in C++. And for that same reason, you don't see many apps do the same thing. Any time Chrome needs to request a permission (access files, location, etc), it _has_ to use the system-provided Java APIs. > Even Google's own Flutter uses a C++ engine to run Dart applications. As do most games, so you can essentially think of Flutter as a game engine that renders apps. > Android's JVM system is a collection of Java wrappers around C++ libraries. As others have mentioned, this is very much not the case.
- ireallywantthat 3y ago> it _has_ to use the system-provided Java APIs. My original comment was against this. Why should this be the case?
- diogenes4 3y ago> There's a reason Chrome is mostly written in C++ Yea, security is not a concern. Apparently.
- tempaccount420 3y agoThey didn't have Rust around when they started.
- diogenes4 3y agoThat doesn't change anything. Security was simply never what chrome (or webkit to be fair) was built around compared to speed of the insanely inefficient browser stack.
- kaba0 3y agoAt 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).