Running the BEAM as C

Does iOS allow several executables in the same app bundle, the main one forking/execing secondary ones?

Kind of wondering if anyone made any significant progress here since the last post. I also am considering using Elixir as a backend for a distributed app but the problem is that the app is going to probably target mobile devices at some point. Not having the ability to run it in a mobile environment would really put a damper on using it.

The mobile app and the backend are to separated things, therefore I don’t see were is the problem of Elixir being used as the distributed backend of a mobile app and not be able of running in a mobile device itself, but maybe I am misunderstanding you, and if so, then please provide some more context, like your concrete use case.

Sorry shouldn’t have made it as vague as I did. I meant as an embedded system that runs along with the android/iOS layer not as a backend in the sense of it being remote. Aka, Beam running on Android/iOS.

For me this was part of the goal with getting the BEAM working on mobile is to have node to node working with mobile to mobile to server or whatever.

Also, the resilience of the BEAM on mobile would be a huge plus.

No progress has been made to my knowledge. The furthest I’ve made it was with experiments with AtomVM which seems promising that someone could get it working with Android NDK and whatever the equivalent on iOS is.

LAM also looks promising if someone has already figured out how to get WASM to work on mobile. You could potentially look at one of the libs already using JS to mobile like Cordova or React Native. While the WASM is promising there is no official support for it yet for mobile so I think it will still have to go through C somehow.

There’s also Bakeware but it isn’t targeting mobile. The biggest problem is the mobile platforms themselves as they are gatekeeping to try to keep bad actors out. You can already run the BEAM on Android pretending it’s Linux but you can’t package it so it’s more difficult than just getting it ‘running’.

I would be really happy if someone could just get AtomVM or ERTS working on Android as I am not enough of a C expert to navigate those waters well.

My bet is on https://github.com/lumen/lumen when it comes to quality alternative BEAM implementations. Its work is backed by DockYard. I don’t think any other alternative BEAM has as much traction. Because it’s an AOT compiler and not an VM it should be better for mobile battery usage too.

here’s another alternative BEAM:

yeah I am also kind of betting on lumen but its not really in a workable state yet.

I know and there are also these ones https://github.com/archseer/enigma and https://github.com/kvakvs/ErlangRT but as you can see they not very active anymore. These projects gets abandoned and I wouldn’t be amazed if same happens to AtomVM at some point. Lumen is different because it has backing. Also because its a compiler it can do dead code elimination these VMs can’t do.

Anyone interested about Lumen’s goals and internals should watch this video from 2019 https://youtu.be/uMgTIlgYB-U (ElixirConf 2019 - Day 1 Morning Keynote - Brian Cardarella, Luke Imhoff, Paul Schoenfelde)