Julia on iOS and Android

Unfortunately it looks like these permissions are for building mac apps that run on the MacOS App Store (such as Building -- and releasing -- a fully self-contained Application written in julia).

Unfortunately I’ve since let my Developer account lapse, so Paddle Battle is no longer on the app store… I’ve tried putting it back, but had problems getting everything to work. :cry:

Would that mean that Julia on iOS would be possible, at least potentially?

But so no, I don’t think this means anything for iOS compatibility. :cry:

1 Like

Ah, darn! :frowning:

In case anyone finds the following helpful/inspiring, here’s a short description of how Swift playgrounds work on iOS w/out a JIT:

Julia might be able to do something similar, at least for functions/call-trees marked as “expensive” in some fashion (doing this for every function would probably be prohibitive). I suspect they have linker customizations and other special sauce to make it work well.

2 Likes

It seems that running Julia on Android may now just be as simple as installing Termux and running apt-get install julia?

I did try and start down the path of building from source and followed the directions here, but I think that may not have been necessary…

2 Likes

Looks like maybe I spoke too soon. The result of trying to add Distributions:

1 Like

It says unable to locate package julia for me

1 Like

Figure it out!

1 Like

Haha thanks! That’s awesome! I got it installed via those same instructions as well. :slight_smile: Neat fun!

$ pkg install wget
$ wget https://its-pointless.github.io/setup-pointless-repo.sh
$ bash setup-pointless-repo.sh
$ pkg install julia  # julia 1.2.0 fork

5 Likes

I’m just compiling Julia inside iSH for iOS which provides a virtualized x86 Linux environment. Will let you know how it goes (binary download of Julia was not working, see https://github.com/tbodt/ish/issues/259 ).

By the way, if it is possible to create something like full x86 emulation iSH (it uses a kind of JIT written in assembly) there must be some similar way to get Julia JIT to run natively with iOS restrictions. Anyone mad enough to dive into this ? :wink:

4 Likes

How do we do that! Can you please elaborate on how to run Julia on termux!

1 Like

Check out my guide here. I found ti searching for Android in this forum

2 Likes

Thank even I found the same guide but I want to connect it a jupyter app and run from browser

Up to now julia can be built for iSH but unfortunately freezes on executing code. One reason could be unimplemented syscalls related to memory management and tracing (e.g. gdb doesn’t work as iSH doesn’t support ptrace syscalls). Anyway, performance wouldnt bee too nice due to emulation.

As a heads up to users of Termux, it looks like Android has had some changes to their security model in Android 10 which may affect (and possible eliminate) Julia functionality:

1 Like

I’ve linked a pretty huge github issue below, but the tl;dr is this: Native code which is not packaged in an .apk may not be executed by the user or non-system applications.

The solution they are currently employing is to repackage everything as .apks, which will be downloaded and installed by the pkg utility in termux. Many applications will still work, including interpreted languages like Python or Ruby. The same cannot be said for compiled languages.

One proposal is to compile code as an apk and installed by the user, but for a language like Julia with as much metaprogramming as it contains may not be compatible with that model.

It may be possible that Julia can still run under proot, albeit with performance penalties.

Have you checked this? I ran Julia some time ago on my Pixel 3, and I’m pretty sure I was running Android 10 at the time?

I haven’t checked it, but at present (and in the near future) it should continue working. Google is enforcing this based on the targetSdk, so even if your device is API 29+ but the app uses API 28 it continues to function, and should do so for at least a few years.

There are two sides to this issue, both of which are relevant to ways in which Google is removing the method on which Termux relies in Android API 29.

  1. Enforcement: Google Play stops accepting app updates which do not target API 29. Currently apps must target API 28 to be accepted on Google Play, and API 28 is what Termux targets. While this will become a problem, it can easily be bypassed by simply installing the Termux apk from elsewhere. This is expected to happen toward the end of 2020.

  2. Technical: This will be the case if a future Android release enforces this security rule for all apps, no matter which API level they target, breaking backwards compatibility (including for Termux). This would affect all apps on a device, including those installed via sources outside of Google Play.

    Google’s handling of security rules for target API 28 in conjunction with Google Play update policy indicates that such a technical change is indeed coming, but likely not for a few years.

2 Likes

That means Android 9. This is easy to misunderstand. I fell into the trap of thinking that non-old Android versions are no longer supported, reading Google’s docs, but actually targetSdk must be set at some level for the app, while minSdkVersion can be much lower.

E.g. Firefox supports very old (discontinued by Google) “Android Jelly Bean or later” by setting minSdkVersion appropriately, I believe.

As Google can’t change already release Android versions (only Google Play policy on apps allowed; or allowed for updates), are you saying, old versions can use Termux forever (and even get updates), but on recent Android versions you get a new API, which, for you is worse?