3 ms·
Why haven't they just started to rewrite it in rust yet?
by phillipcarter 6y ago
Why haven't they just started to rewrite it in rust yet?
- pjmlp 6y agoIndeed, however Google's usage of C and C++ sometimes is quite interesting. For example, Android source code is also not a very good example of modern usage of C++ security features. After 10 years, the NDK keeps having a C only API space, with all the memory corruption issues that it entails, even though the actual implementations are in C++ or Java (via JNI). So their workaround, starting with Android 11, is requiring hardware memory tagging in all ARM devices, while having kernel fuzzing support for other platforms lacking such hardware capabilities.
- gmueckl 6y agoThe C only interface is an absolute necessity. Only C++ can properly interface with C++ while C can interface with the rest of the world. And system libraries are there for whole world to use. if the system interfaces were converted to C++, all applications need to be written in C++ as well. You can wrap some features in other languages, but definitely not all of them.
- pjmlp 6y agoRight, but in 10 years they surely would have the time to offer a type safe C++ API in addition, just like in other platforms. Instead, they have been postponing it since NDK was introduced in Android 2.0 until after the introduction of native packages, which will only arrive with Android 11. There are open tickets related to it.
- blargmaster33 6y agoBecause : 1 : Rust syntax is weird, why not go with c/c++/java/c# like syntax? 2 : Rust has SJW bagage that turns alot of closet conservatives/libertarians off the language. There are two genders and a bunch of people with mental problems.
- Leherenn 6y agoBecause the expected cost of dealing with those security issues has not yet surpassed the expected cost of a rewrite.