Mobile is the new PC and AArch64 is the new x64

Joakim dlang at joakim.fea.st
Wed Sep 12 08:09:46 UTC 2018


On Tuesday, 11 September 2018 at 08:34:31 UTC, Chris wrote:
> On Tuesday, 11 September 2018 at 07:23:53 UTC, Joakim wrote:
>
>>
>> I agree with a lot of what you say here, but I'm not sure what 
>> you mean by "first class support for mobile." What exactly do 
>> you believe D needs to reach that level?
>
> Basically the things you describe. I was thinking of a stable 
> and easy build system, e.g.
>
> $ dub init android [iOS]
>
> $ dub --arch=arm64

Yes, something like that should be done, but I won't be doing 
much with dub till next year. If anyone else is interested in 
doing it earlier, feel free.

> And and of course check which language features work (or don't 
> work!) on ARM and write a documentation.
>
> Cf. https://kotlinlang.org/docs/reference/native-overview.html

I don't see any language features listed for Kotlin there, but 
ldc does have an AArch64 tracker issue, which lists what else 
needs to be done:

https://github.com/ldc-developers/ldc/issues/2153

>> It might be a good idea to set up a funding target to get the 
>> iOS port back up to speed again. I don't use Apple products so 
>> it won't be me picking up that porting work, but maybe Dan 
>> could be enticed to finish it as a paid project, since he did 
>> most of the voluntary work so far. I'm purely speculating, no 
>> idea if money changes the equation for him, just know that 
>> he's been too busy to work on it for the last couple years.
>
> That'd be part of the first class support. That a dedicated 
> team works on it. Volunteers are not enough. Once it's polished 
> it will still need loads of maintenance.

I don't think there's a "dedicated team" for any platform that D 
runs on, so we don't have "first class support" for any platform 
then.

D is largely a volunteer effort: if that's not enough, maybe D 
isn't right for you. This isn't Kotlin or Swift, where one of the 
largest companies in the world puts full-time devs on the 
language and gives everything away for free because it suits 
their agenda.

In Apple's case, that means Swift doesn't really support Android 
and definitely doesn't support Android/AArch64, because putting 
full-time devs on getting Swift working well with Android doesn't 
suit their agenda of pushing iOS:

https://github.com/apple/swift/blob/master/docs/Android.md
https://blog.readdle.com/why-we-use-swift-for-android-db449feeacaf

However, since Swift is largely open source, there is a small 
company that claims to have added Android/AArch64 support to the 
Swift compiler:

https://www.scade.io

Kotlin is becoming more cross-platform now since google is more 
cross-platform, but then you're depending on google continually 
funding development on an OSS project, which they've backed out 
of before:

https://arstechnica.com/gadgets/2018/07/googles-iron-grip-on-android-controlling-open-source-by-any-means-necessary/

I don't fault google for making those choices, as nobody has a 
right to their OSS contributions, but it is something to consider 
when using any platform, and even more so for an OSS project: who 
is funding this and why? Will their model be sustainable?

There are no easy answers here: if you want a free-priced, OSS 
toolchain, you're going to be marching to the beat of someone's 
drum.

As for ongoing maintenance, Android/ARM was done years ago and 
hasn't taken much in the way of maintenance to keep most of the 
stdlib/dmd tests passing, so I don't think that's much of an 
issue.

btw, it was a thread _you_ started that finally spurred me to 
begin this Android port five years back, though I'd enquired 
about and had been considering it earlier:

https://forum.dlang.org/thread/yhulkqvlwnxjklnogmfv@forum.dlang.org

On Tuesday, 11 September 2018 at 16:50:33 UTC, Dejan Lekic wrote:
> On Monday, 10 September 2018 at 13:43:46 UTC, Joakim wrote:
>> LDC recently added a linux/AArch64 CI for both its main 
>> branches and 64-bit ARM, ie AArch64, builds have been put out 
>> for both linux and Android. It does not seem that many are 
>> paying attention to this sea change that is going on with 
>> computing though, so let me lay out some evidence. ...
>
> I mostly agree with you, Joakim. I own a very nice (but now 
> old) ODROID U2 (check the ODROID XU4 or C2!) so ARM support is 
> important for me...
>
> Also, check this: 
> https://www.hardkernel.com/main/products/prdt_info.php?g_code=G152875062626
>
> HOWEVER, I think Iain is right - PPC64 and RISC-V are becoming 
> more and more popular nowadays and may become more popular than 
> ARM in the future but that future is unclear.

If and when they do, I'm sure D and other languages will be 
ported to them, but right now they're most definitely not.

I know because I actually looked for a RISC-V VPS on which to 
port ldc and found nothing. Conversely, I was able to rent out an 
ARM Cubieboard2 remotely four years back when I was first getting 
ldc going on ARM:

https://forum.dlang.org/post/steigfwkywotxsyppvza@forum.dlang.org

I contacted one of the few companies putting out RISC-V dev 
boards, Sifive, a couple weeks ago with the suggestion of making 
available a paid RISC-V VPS, and one of their field engineers got 
back to me last week with a note that they're looking into it.

I think their model of having an open ISA with proprietary 
extensions will inevitably win out for hardware, just as a 
similar model has basically won already for software, but that 
doesn't mean that RISC-V will be the one to do it. Someone else 
might execute that model better.

On Tuesday, 11 September 2018 at 21:37:17 UTC, Neia Neutuladh 
wrote:
> On Tuesday, 11 September 2018 at 07:23:53 UTC, Joakim wrote:
>> I agree with a lot of what you say here, but I'm not sure what 
>> you mean by "first class support for mobile." What exactly do 
>> you believe D needs to reach that level?
>
> Natural-feeling bindings to platform libraries that are not 
> incredibly slow and that are well-maintained. What does it 
> matter that you can run a webserver from your phone if you 
> can't write a "hello world" GUI program, set an alarm, or 
> enqueue a download?

There are those who run the webserver as an app and reuse their 
webapp as a mobile app, since mobile always comes with a webview 
or browser. You can now do that with your vibe.d web app if you 
choose, I'd say that matters.

I don't think any other platform D supports has the type of 
"well-maintained" bindings you're asking for either, hasn't 
stopped those that want to use D.

I've got a bit better than "hello world," though that's there 
too, in the sample D apps in my android repo and the instructions 
in the wiki:

https://github.com/joakim-noah/android/tree/master/samples
https://wiki.dlang.org/Build_D_for_Android


More information about the Digitalmars-d mailing list