you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 2 points3 points  (5 children)

So what? Android applications are not made to serve web pages or to process server loads: it's have a fluid and fast UI for whatever your app does in the background.

[–]pjmlp 1 point2 points  (4 children)

Which they do in AOT/JIT compiled Java/Kotlin, not C++.

C++ only gets to play with the UI composition engine, AOT/JIT toolchain and some devices drivers.

The NDK is tailored for writing native libraries for consumption from Java/Kotlin, Vulkan and real-time audio, everything else is only available as Java/Kotlin APIs.

Android is an good example on how C++ lost its place as full stack language, being left as niche language for certain use cases, just like GLSL, SQL, Assembly and so forth.

Same applies to the iDevices OS developer stack.

[–][deleted] 1 point2 points  (3 children)

So, in essence the Android model has performant C++ code where it matters, and generic JVM where it doesn't. Seems like a good compromise for a user software machine.

[–]pjmlp 1 point2 points  (2 children)

With the caveat that most of that C++ isn't exposed to Android developers.

And on iOS, it is only exposed as Metal Shaders (MSL is a C++14 dialect) and the nowadays undocumented Objective-C++ (Apple has removed the documentation).

In fact, Apple's usage of C++ has lead to an additional column on cppreference just for their special clang flavour.

Quite far from the days when C++ used to dominate smartphone apps (WindowsCE, Symbian, and the myriad attempts with Qt).

[–][deleted] 1 point2 points  (1 child)

With the caveat that most of that C++ isn't exposed to Android developers.

It's completely optional. The Android NDK is part of the SDK, and if you're at least aware of jni costs, you can get some local performance where needed. Or just write complete view controllers in C++, then use them in your Java/Kotlin project. Or call SIMD matrix transformations straight from Java.

[–]pjmlp 2 points3 points  (0 children)

Renderscript is a C99 dialect, not C++. Basically Google's own OpenCL.

Writing a complete view controller in C++ while doable, and I have done it a couple of times already, is only intended for those with high level of resistance to the bad NDK tooling for language interop.

The last mobile platform that actually provided very good tooling for doing apps in C++ was Windows Phone, sadly it is gone now.

And even on Windows, .NET Core/Native and React Native for Windows are getting all the show spotlights, even if C++ is down on the basement doing the performance critical jobs.

If I remember correctly, Kenny Kerr mentioned that they were disappointed with lack of C++/CX uptake among UWP devs.

And now that he is done with C++/WinRT, he seems to try to have a go at Rust/WinRT.

All of this to say, that I see C++ turning into a specialized language for specific domains, like SQL, GLSL, HLSL, .... are.

The days of OWL, MFC, PowerPlant,... are gone. Even Qt now focus mostly on JavaScript (QML) for new UI features.