New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add iOS support to Substrate VM #373

Open
sirthias opened this Issue Apr 23, 2018 · 12 comments

Comments

6 participants
@sirthias
Copy link

sirthias commented Apr 23, 2018

If Substract VM allowed for writing libraries in any of the supported languages (most importantly Java) and these libraries could be called into from iOS application code (written in Swift or Objective-C) then this would be a complete game changer for the "holy grail" of mobile development: Joint code bases for truly native mobile applications.

Rich client logic could then be written purely in Java, packaged as a library and be usable from thin layers of UI code on either platform. Currently this is not properly possible.
There are a few tools promising a solution in that area (e.g. Robo VM or Multi-OS-Engine), but they all come with quite a few strings attached and severely lack the technological soundness of Graal.

It'd be absolutely awesome if Graal would finally be the tool to properly bridge this so far insurmountable chasm between the two major mobile universes.

@cstancu

This comment has been minimized.

Copy link
Member

cstancu commented Apr 23, 2018

Hi @sirthias, iOS support is on our TODO list. AFAIK the kernel design on iOS is essentially the same as macOS, which we currently support. But first we need to implement AArch64 support. The Graal team is already working on an AArch64 back-end. Once that is implemented we need to extend the AArch64 support to SubstrateVM. Then we can support JVM languages that are currently supported on other platforms, i.e, Java, Scala, Kotlin, etc. As for other languages, i.e., JS, Python, etc., they are implemented using Truffle/Graal on top of SubstrateVM and interpreted/JITed at runtime. On iOS you cannot allocate executable memory so JITing is not possible. However you can still run Truffle languages in interpreter mode.

@sirthias

This comment has been minimized.

Copy link
Author

sirthias commented Apr 23, 2018

Thank you for this additional info, @cstancu!
So, JVM languages will be supported (eventually) via SubstrateVM's AOT compiler, but everything requiring Truffle/Graal can never be supported since JITting is disallowed on iOS.

While it'd be theoretically better to also have JS, Python, Ruby, etc. supported on iOS I'd say that the by far more important target is Java (and other JVM languages) since they are what people are already using on the Android side.

So to me the prospect of having SubstrateVM-powered Java/Scala/Kotlin/Closure-libraries run nicely on iOS is absolutely fantastic!

What would you personally say, how long the AArch64 support will take to arrive in SubstrateVM?
I know that estimates like this always have to be taken with several giant boulders of salt but it's still interesting to understand what the rough magnitude of this effort is and thus whether it's likely going to take months or rather years...

@cstancu

This comment has been minimized.

Copy link
Member

cstancu commented Apr 23, 2018

The Truffle languages can be supported as long as Truffle runs in interpreter mode. You won't get the same performance as with a JIT but it would still be useful for certain scenarios.

@cstancu

This comment has been minimized.

Copy link
Member

cstancu commented Apr 23, 2018

As for estimates, it is hard to give any estimate at this time, but it is definitely months not years. And of course we accept pull requests and would provide assistance if anyone wants to work on it.

@sirthias

This comment has been minimized.

Copy link
Author

sirthias commented Apr 24, 2018

Ok, great. Thank you, @cstancu!

@zaharidichev

This comment has been minimized.

Copy link

zaharidichev commented May 22, 2018

Hi there @cstancu Thanks a lot for elaborating on these topics. So it appears to me that the two major pieces of work are finishing the AArch64 compiler backend and then providing support for that in SVM.

Is there any kind of board outlining planned broken down work on any of these major tasks. Just asking because if there is any way to help, I would be more than glad to (although the matter can be at times intimidating).

I see @daniel-stewart-qdt is doing some work on AArch64, so maybe he can provide some info on what the next planned steps are as well. In any case, willing to help where and how I can :)

@ScalaWilliam

This comment has been minimized.

Copy link

ScalaWilliam commented Oct 27, 2018

This is interesting.

@priand

This comment has been minimized.

Copy link

priand commented Jan 11, 2019

@cstancu Any ETA on the iOS support? As @sirthias said, having a AOT compiler for JVM based languages will be a game changer for the Java community.

@sanzinger

This comment has been minimized.

Copy link
Member

sanzinger commented Jan 14, 2019

We have no ETA for this. We are currently working on SubstrateVM on AArch64 for Linux (See #910). Other platforms are not decided yet.

I hope this answers the original question.

@sanzinger sanzinger closed this Jan 14, 2019

@sanzinger sanzinger self-assigned this Jan 14, 2019

@sirthias

This comment has been minimized.

Copy link
Author

sirthias commented Jan 16, 2019

@sanzinger The description text of this ticket does not include any question.
Rather, this ticket was meant as a point of reference for other people looking for information about graal support for iOS. Judging from the number of upvotes and comments it appears to me as this ticket was actually doing this job.

Therefore I am a bit surprised to see it simply being closed, especially since the PR you've referenced doesn't mention "iOS" anywhere.

Does your closing of this ticket actually mean "Won't Fix"?
If no, i.e. there hasn't been a decision to not support iOS eventually, would it maybe be better to keep this ticket open until such a decision has actually been made, iOS support is available or another ticket properly supersedes it?

@sanzinger

This comment has been minimized.

Copy link
Member

sanzinger commented Jan 16, 2019

At the moment we do not have a decision if we are going to support iOS. At the moment we are occupied getting AArch64/Linux running.

I think we get a clear picture how iOS goes, when we have completed AArch64/Linux in a usable state.

@sanzinger sanzinger reopened this Jan 16, 2019

@sirthias

This comment has been minimized.

Copy link
Author

sirthias commented Jan 16, 2019

Thank you for this update and re-opening the ticket, @sanzinger!
Much appreciated!

We are keeping our thumbs crossed for iOS support eventually making it onto the Graal roadmap.
We still think it would be absolutely awesome to have and would unlock a ton of opportunities on many fronts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment