Hacker News new | comments | show | ask | jobs | submit login

I've tried using the NDK too, specifically to compile the Objective C framework ObjFW [1] on one of the few platforms where it's not yet confirmed working. Unfortunately, the gcc they include in the NDK has Objective C disabled for seemingly no reason, and bootstrapping your own gcc or clang toolchain is pretty tough. I'm sure you don't see as much of a need with C++, but have you ever tried replacing parts of the toolchain?

[1] https://webkeks.org/objfw/

There is a very good reason for disabling Objective C in NDK.

Objective C, the syntax, has very little value without Objective C runtime/standard library and Objective C runtime/stdlib is huge (compared to C and C++ standard libraries).

NDK has a very specific goal: if the code would be too slow when compiled to Dalvik VM, you can get speed with NDK, writing in C/C++, but at the cost of loosing access to almost all of the APIs that Android provides. This tradeoff more or less makes sense only for games.

Implementing Objective C runtime and standard library would be huge undertaking and the code, when used, would occupy more memory. Also, this code would mostly duplicate C++ standard library, just with a different syntax.

It doesn't make sense to allow people using Objective C in NDK.

"the gcc they include in the NDK has Objective C disabled for seemingly no reason" - I wonder how heavily they modified gcc to cope with security models etc. Quite possibly there's a very good reason. It might have been a ton of work to get it working properly.

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact