Julia on Android (and/or the web) - a scientific calculator on steroids.. good for tablets

2,051 views
Skip to first unread message

Páll Haraldsson

unread,
May 28, 2015, 10:17:08 AM5/28/15
to julia...@googlegroups.com

I've noticed: "I guess we can announce alpha support for arm in 0.4 as well." (and the other thread on Julia on ARM).

Now, Android runs on x86 (already covered, then if you have that kind of device, no need to wait for ARM support), ARM, and MIPS (actually do not know of a single device that uses it..).


I would like to know the most promising way to support Android and..

A. For Firefox OS and the web in general, and hybrid apps, compiling to JavaScript (or Dart and then to JavaScript) would be a possibility, with asm.js/Emscripten.

B. Just making native Android apps is probably easier. Assuming the ARM CPU is solved, it seems easier. And iOS would be very similar.. But would not work for Firefox OS - not a priority for now, but the web in general would be nice..


B. seems more promising except for the tiny/non-existent MIPS "problem".. Also better long term, for full Android framework support and full Julia support (concurrency/BLAS etc. that JavaScript would not handle).


1. Just getting Julia to work on Android is the first step. Just the REPL, wouldn't have to be Juno IDE etc. or GUI stuff.

2. You could to a lot with just the REPL and a real keyboard or just an alternative programmers virtual keyboard.. However, graphing would be nice, and what would be needed? What are the most promising GUI libraries already supported by Julia (or not..)? Say Qt, supported by Julia and Android. Would it just work?

3. Long term, making apps, even standalone (Julia "supports" that) with Julia. If GUIs work for graphing, is then really anything possible? I know Android/Java has a huge framework. Google is already supporting Android with Go (without any Java) as of version 1.4 and with Dart (for hybrid apps). For Go they have a "framework problem" going to support games at first. Some people are sceptical about Julia and games because of GC (I'm not so much). I note Go also has GC..

JavaCall.jl only works for JVM not Dalvik or ART. Would it be best to just use the native C support on Android or somehow go through Go? Anyone already tried to call Go from Julia? Rust is possible, but doesn't have GC. Go should be possible, just as Java, but have similar problems..

Do/could macros somehow help with supporting the full Android framework? Julia already has "no overhead" calling, could you generate bindings from automatically from some metadata and/or on the fly?


This could be a cool pet project - anyone else working along these lines?

Any reason plan B couldn't succeed relatively quickly? There are some ways to make apps *on* Android already, I think all crappy, Julia wouldn't be..?


Thanks in advance,
-- 
Palli.

Simon Danisch

unread,
May 28, 2015, 4:28:57 PM5/28/15
to julia...@googlegroups.com
I hope my 2D/3D rendering efforts get somewhere and we will then be able to power GUI's and visualization on android.
In theory, everything should just work out, as soon as Julia runs on android, and I extend OpenGL to OpenGL ES.
At least that's what I hope... If things go really smooth, we might just need to wait for Vulkan, and the produced OpenGL code will just run on any mobile device. 
And if things go even better, Julia could compile directly to SPIR-V (Vulkans Intermediate Representation, which we could generate from LLVM IR).
Like this, we could have ultimate speed even for mobile devices with very little hassle.
All in all, if everything comes along really great, we might be able to use Julia as a foundation for a terrific, high performance, GUI/Visualization library, which runs everywhere LLVM can spit out assembly for.

Páll Haraldsson

unread,
May 29, 2015, 6:44:02 AM5/29/15
to julia...@googlegroups.com
This is great! More than I hoped for. Seems you are confirming plan B. (over A). I didn't know Julia could support Vulkan/SPIR. That is the future (not now on Android and might not appear for older Android versions..). For now OpenGL ES is not supported and then no 3D for Android?

Anyway, I wasn't aiming for 3D [and/or] games as a first step. Would visualizations, graphing, Interact.jl, etc. depend on 3D..? Should 2D work right away?

While a little of-topic, as more an Android question rather than a Julia one: What GUI libraries would work best there? You do not have X or Wayland (or Windows API..). Qt works on Androids (to not know about GTK) - Julia works with Qt =>Julia+Qt works on Android?

And native frameworks on Android, for GUI or otherwise, what would be to most promising way to support them?

I know about @linux, @unix (and @windows etc.) macros. I assume @linux would be appropriate and @android not needed (is there @freebsd..?).

I'm not really sure how extensively @linux is used and for what, I just noticed for choosing wget, fetch etc. I assume some of that might break, and not sure if PATHs (directory structure is a little different..) and/or that Android is sandboxed would matter. Julia doesn't need any root access stuff?

-- 
Palli.

Simon Danisch

unread,
May 29, 2015, 7:22:49 AM5/29/15
to julia...@googlegroups.com
> For now OpenGL ES is not supported and then no 3D for Android?

What do you mean by that? Not yet supported in Julia? It's supported on Android, and Julia support could be achieved fairly quickly. 

I personally first tried to get 3D under control, as it has higher performance demands and therefore shapes the infrastructure more...But slowly the 2D support is dripping in.
And while we're dreaming, hopefully we will be able to create fairly nice native GUI's with Julia. We will see... 
I'm pretty sure, that we'll be able to nail high performance and cross-platform abilities, but I'm a little worried if the usability also works out. 
But looking at other tools, it seems that the bar is not set very high :D
QT seems to offer a huge ecosystem with a lot of convenient tools. I wonder, if people will always prefer QT, or if one would prefer a lightweight Julia solution in the end (If both are available).
My main reason against using QT is probably the complexity... 
A Julia wrapper for QT would probably be already more complex than my whole 3D library :D 
And extending it can be done by Julia programmers easily, so we would have more freedom to evolve the GUI ecosystem in our way, specialized for Julia and scientific computing.


Am Donnerstag, 28. Mai 2015 16:17:08 UTC+2 schrieb Páll Haraldsson:

Páll Haraldsson

unread,
May 29, 2015, 8:02:56 AM5/29/15
to julia...@googlegroups.com
On Friday, May 29, 2015 at 11:22:49 AM UTC, Simon Danisch wrote:
> For now OpenGL ES is not supported and then no 3D for Android?

What do you mean by that? Not yet supported in Julia?

Yes, or strictly your package (yet). And that is no criticism. Besides:

It's supported on Android, and Julia support could be achieved fairly quickly.

Yes, as far as I know, OpenGL ES (in various versions) are the only 3D options in Android (and something on top of that, RenderScript and WebGL in browser and probably hybrid apps). I know the dis/similarity with regular OpenGL - probably a low bar to jump, unlike Vulkan?
 
I personally first tried to get 3D under control, as it has higher performance demands and therefore shapes the infrastructure more...But slowly the 2D support is dripping in.

While 2D is a subset of 3D [in OpenGL] I think people use other APIs generally for 2D work [on Android]?

Anyway, I wanted this thread to not only be about 3D/2D/GUIs on Android but the frameworks that are already there.. and how to support them. They are also for say, sound, GPS, networking etc. For a start ("a scientific calculator on steroids"..) it would not matter. Or what? I wander what is needed for minimal Julia [REPL] functionality. Julia uses git and then networking to get packages (and even compilers for [C] code..). Are there any assumptions in Julia that say, the shell has to be bash or wget available etc. [anyone know the full set of those "dependencies" - may not be need to know as we will just out when running.. "halting-problem"..). These could all just be bundled with? If bash you have GPL (as a "mere aggregation").
 
And while we're dreaming, hopefully we will be able to create fairly nice native GUI's with Julia. We will see... 
I'm pretty sure, that we'll be able to nail high performance and cross-platform abilities, but I'm a little worried if the usability also works out. 
But looking at other tools, it seems that the bar is not set very high :D

Not clear what you mean, to make apps *for* Android, not *on* (for "on" (or "for"..), there are not that many and all visual style?)? Yes, Java is perceived as the best option and I think Julia would be better in every way except the [legacy] framework problem. Even Google with Go, considers the framework a problem..
 
QT seems to offer a huge ecosystem with a lot of convenient tools. I wonder, if people will always prefer QT, or if one would prefer a lightweight Julia solution in the end (If both are available).
My main reason against using QT is probably the complexity... 

I'm not saying it has to be QT. GUI in Android is "different" anyway than for desktop. I'm however thinking, can we use what is already supported by Julia, not to avoid (writing new) native Julia, but also so there is a possibility of making something that works in Android but also cross-platform to desktops. It's probably a stretch anyway, in any language. The web has that in a way.. Only reason I would consider that as a quicker way to Android and get iOS and Firefox OS for free. It would however have lots of limitations on Android and elsewhere and miss out on Julia stuff..

Say you would want to support iOS (or Windows Phone) additionally, would you consider that much additional work? Apple doesn't allow GPL v3 and maybe GPL v2, that Julia uses but the GPL libraries (except libgit) are optional. Not sure they would consider Julia a VM and ban it on those grounds. I guess when Julia flies on Android they will want the same apps on iOS..

A Julia wrapper for QT would probably be already more complex than my whole 3D library :D 
And extending it can be done by Julia programmers easily, so we would have more freedom to evolve the GUI ecosystem in our way, specialized for Julia and scientific computing.


Simon Danisch

unread,
May 29, 2015, 8:52:22 AM5/29/15
to julia...@googlegroups.com
Oh, nothing was seen as criticism or that you prefer approach A over B ;) I was just bubbling about the things I've been thinking about lately!

>probably a low bar to jump, unlike Vulkan?
I think I'm not using many features which don't map to OpenGL ES easily. So yeah, should be quick to do.


I hope IOS will go smoothly, as Apple is the company most involved with LLVM (SWIFT etc)... But who knows, probably that's exactly the reason to get stingy with any other LLVM project.

If someone has a lot of time, we could write a Julia library, much like GLFW, which supports all sorts of events and context/window creation in a cross-platform way, including IOS and Android.
So we could just abstract this away, preferably via Reactive.jl. So you could just have a GPS or Image (e.g. from the webcam) signal, regardless of the platform ;)
From what I know, there should be no problem to call the phones API, as it doesn't seem to be a problem to get them from C/C++.

Oh yeah, Tango would make a lot of sense together with Julia ;)

I can't really answer your other questions... But there are some tools on the way, which hopefully will make it easier to get dependency graphs and such from Julia packages. (e.g. https://github.com/IainNZ/MetadataTools.jl)



Am Donnerstag, 28. Mai 2015 16:17:08 UTC+2 schrieb Páll Haraldsson:

Simon Danisch

unread,
May 30, 2015, 5:39:32 AM5/30/15
to julia...@googlegroups.com
>But looking at other tools, it seems that the bar is not set very high :D
Just realized that this sounds quite arrogant without some context ;)
This just applies to fast and extendable libraries. You could not really extend HTML itself, could you?
So QT seems to be one of the libraries, that is good at everything...But I think wrapping it for Julia will negate some of the appeals. 

And your other questions should probably be turned into a Julia issue, to collect milestones and issues that need to get resolved in order to get Julia to Android && IOS (&& Windows Phone).


Am Donnerstag, 28. Mai 2015 16:17:08 UTC+2 schrieb Páll Haraldsson:

Páll Haraldsson

unread,
Aug 27, 2015, 6:18:47 AM8/27/15
to julia-users
Your're right. I made an issue:

https://github.com/JuliaLang/julia/issues/12825

It seems Julia on Android's time could be coming soon (even ARM).

Michael G

unread,
Mar 8, 2016, 10:58:06 PM3/8/16
to julia-users
I am maintaining the SL4A project and we are getting requests to add Julia to the repo. Is anyone interested in helping out so we can run julia on SL4A??? I would need a little help on implementation since I am unfamiliar with the language....

-Michael 

Viral Shah

unread,
Mar 8, 2016, 11:05:59 PM3/8/16
to julia-users
I took a hard look at porting Julia to Android with a friend's help who is a core Android developer at Google. The android toolchain was the most daunting part, and I got stuck at cross compilation of julia dependencies.

I personally would love to help get julia on android, as I have heard many such requests myself, but am not very familiar with the android toolchain. I can help out with the julia side. With x86 support, the right way forward would be to find a powerful android device where one can build julia from source instead of cross compliation - if such a thing is possible.

-viral

Lutfullah Tomak

unread,
Mar 9, 2016, 1:17:01 AM3/9/16
to julia-users
I think the most crictical one that toolchain misses is (lib)gfortran support. I managed to build gfortran for cross compile but I think I am missing pure hard float libgfortran to compile libopenblas with. For android, libopenblas expect hard float libraries. In google provided toolchain, hard float libraries in .../armv7-a/hard but I don't have .../armv7-a/hard directory in my personal build of toolchain. Nevertheless, I can build openblas with lapack support but netlib provided tests does not work well. Blas passes tests.
Also, for some dependecies including llvm, there is an app called termux. They have source package build system available at https://github.com/termux/termux-packages . It can be helpful to look at. They listed julia in their package suggestion page for some time https://termux.com/package-suggestions.html .

Viral Shah

unread,
Mar 9, 2016, 1:32:02 AM3/9/16
to julia...@googlegroups.com
How about making this a GSOC project? Could you perhaps submit a PR to the GSOC project page on julialang.org with these ideas, since you seem to have made the most amount of progress here?

-viral

Lutfullah Tomak

unread,
Mar 9, 2016, 11:35:53 AM3/9/16
to julia-users
Sure I can write a proposal or suggestion and  if there is an interested student I can help the work. I use my phone a substitute for pc so much and right now I use a linux chroot app for julia but it is slow compared to native apps like termux provides. The thing is I've recently started to a new job so it may not be straight away.

Ismael Venegas Castelló

unread,
Mar 9, 2016, 11:38:37 PM3/9/16
to julia-users
Here is a keep recap of what I've been able to achieve so far:


Lutfullah Tomak

unread,
Mar 10, 2016, 6:22:53 AM3/10/16
to julia-users
Hi Ismael,
As I said I cannot do on my own since I've just started a new job. If there is an interested student I can help him/her though
I am not software engineer. I've just curious about julia on android as you are. So, it's a little overestimate you do on gitter
sorry about that. I can write a suggestion about it in julia-opt or a related place and intersted party can carry on there.

Ismael Venegas Castelló

unread,
Mar 10, 2016, 7:22:17 AM3/10/16
to julia-users
Of course I understand that, it's not my intention to make assumptions or tell people otherwise. I just wanted to show to the community that the interest for Julia on Android is anything but fading away. I've never participated in an event such as GSOC, but since this semester I return to School I'm interested in considering this and the possibilities that may arise. :D I'm going to educate myself about all that a GSOC project entails, thanks for your help.

Viral Shah

unread,
Mar 10, 2016, 7:38:04 AM3/10/16
to julia...@googlegroups.com
If there is someone who applies with the right background in build systems, Android and tooling, I am happy to find mentors - both on the Julia and Android side to make this port successful.

The important thing is to get something up on the ideas page.

Another platform for an embedded port that has come up in my discussions with people is openwrt.

-viral



> On 10-Mar-2016, at 5:52 PM, Ismael Venegas Castelló <ismael...@gmail.com> wrote:
>
> Of course I understand that, it's not my intention to make assumptions or tell people otherwise. I just wanted to show to the community that the interest for Julia on Android is anything but fading away. I've never participated in an event such as GSOC, but since this semester I return to School I'm interested in considering this and the possibilities that may arise. :D I'm going to educate myself about all that a GSOC project entails, thanks for your help.
>
> El jueves, 10 de marzo de 2016, 5:22:53 (UTC-6), Lutfullah Tomak escribió:
> Hi Ismael,
> As I said I cannot do on my own since I've just started a new job. If there is an interested student I can help him/her though
> I am not software engineer. I've just curious about julia on android as you are. So, it's a little overestimate you do on gitter
> sorry about that. I can write a suggestion about it in julia-opt or a related place and intersted party can carry on there.
>
> On Thursday, March 10, 2016 at 6:38:37 AM UTC+2, Ismael Venegas Castelló wrote:
> Here is a keep recap of what I've been able to achieve so far:
>
> * https://gitter.im/termux/termux?at=56e0f41a6fde057c26856001
>
>
>
>
>

Lutfullah Tomak

unread,
Mar 16, 2016, 9:12:29 AM3/16/16
to julia-users
Hi again,
I tried to pull out what I have so far to write down a suggestion but I've lost them because I updated the ndk version and all related files deleted.
I tried again what I remember but I cannot build libgfortran this time cannot go on there.
Yet, I think adding an entry for this will attract interested students. Also, I think it can be broader in the sense that how julia can be ported other architectures
and/or systems.
Sorry for this.

Páll Haraldsson

unread,
Apr 1, 2016, 7:36:39 AM4/1/16
to julia-users
On Wednesday, March 9, 2016 at 3:58:06 AM UTC, Michael G wrote:
I am maintaining the SL4A project and we are getting requests to add Julia to the repo. Is anyone interested in helping out so we can run julia on SL4A??? I would need a little help on implementation since I am unfamiliar with the language....

Are you all aware of the Julia-lite fork (reduced standard library, sane "language") of Julia? I would guess it would be easier to support on Android (and sufficient for many).

At least Julia-lite could be (maybe [almost] works already?) a milestone to full Julia.

Interesting/good to know, that somebody took my idea seriously.

I'm aware of SL4A, do not fully remember pros and cons. Who is making requests, or at least for what purpose? E.g. is say, linear algebra (or BigInt) involved? While I said "scientific calculator" originally, it was for proof-of-concept (and useful), but my mind is set on general programming for Julia, not much math involved, as with some others, such as, the Julia-lite brancher.

Reply all
Reply to author
Forward
0 new messages