What are we going to do about mobile?

rikki cattermole via Digitalmars-d digitalmars-d at puremagic.com
Wed Apr 12 02:43:35 PDT 2017


On 12/04/2017 10:37 AM, Joakim wrote:
> On Friday, 7 April 2017 at 09:40:26 UTC, rikki cattermole wrote:
>> On 07/04/2017 10:34 AM, Joakim wrote:
>>> On Thursday, 6 April 2017 at 05:32:41 UTC, rikki cattermole wrote:
>>>> IMO there is two things that need to be done to get D for mobile:
>>>>
>>>> 1: ldc needs to natively target and distribute binaries for Android
>>>> (MIPS, ARM, at least).
>>>
>>> I'm not sure what you mean by "natively target."  Do you mean that the
>>> shipping ldc compiler should come with Android/ARM target support built
>>> in?  That can be done, but it's useless without a stdlib cross-compiled
>>> for the target and ldc doesn't provide the cross-compiler
>>> scripts/toolchain with its releases that would allow you to easily start
>>> cross-compiling, even though the compiler itself is capable.  Instead, I
>>> provide a cross-compiler for linux/x64 that comes with a cross-compiled
>>> stdlib for Android/ARM, and link to instructions on how to use it with
>>> the Android NDK toolchain.
>>
>> So basically druntime, Phobos all good to go basically be able to do
>> ldc2 test.d and get a valid (yet to be apk'd) executable. But the
>> point was to have it all officially supported and ready to go with
>> clear instructions on how to use it.
>
> That's all available from my Android releases: the only part you could
> say is missing is "official support," since they're not put out on ldc's
> official github release page.
>
> There are a couple issues that block that, one of which I mentioned
> above: ldc has never released a cross-compiler with a cross-compiled
> stdlib, or at least scripts that make it easy to cross-compile the
> stdlib yourself, and instructions on integrating with some
> cross-compilation toolchain.  Another is that my cross-compiler
> currently requires a lightly tweaked llvm.
>
>>>> 2: extern(JNI) seriously, its a pain to work with Java over JNI
>>>> otherwise. It would be worse then not having extern(Obj-C).
>>>
>>> I don't think it's that bad, but sure, we could always make it easier.
>>
>> After working on djvm, there is no way I'd want to not have it. It's
>> just too hard to do it library only.
>
> I have not tried djvm yet, perhaps we could work together on this.

I don't have the time nor knowledge of dmd-fe internals to do this. It 
really needs to be a priority of the D Foundation to accomplish this or 
a very highly motivated individual with time to burn.

JNI itself isn't hard to work with, its mapping classes for D easily to 
it which is hard. Especially when inheritance comes into play.


More information about the Digitalmars-d mailing list