Is it possible to create iOS apps with OCaml? I know it might take some extra work to use a foreign-function interface to call Objective-C functions to create the UI objects. But I’m wondering if I can cross compile for ARM and send a binary to my iPhone, and eventually the App Store. I’ll be working from macOS (x86).
I’m also interested in macOS apps for the App Store, which probably require cross-compiling to make an ARM+x86 binary of some kind.
Can confirm: I knew a guy who built a UI-intensive iOS app for iPhone and iPad, sold it on the store, for a good number of years. Don’t know if he does anymore, b/c lost touch with him after Nov 9 2016 (for obvious (political) reasons).
Option 1: I mentioned last week in an unrelated thread that there is an opam package dkml-base-compiler that does cross-compilation. It supports most of the Android cross-compile matrix (ex. x86 → arm32), and the macOS (ex. x86_64 → arm64). I haven’t updated the official opam package to do iOS cross-compiles b/c most of my open-source time commitment has been for Windows. If you know how to compile the OCaml compiler, please extend that package! The bits will be very similar to the macOS cross-compiler, and I can guide you. See: https://discuss.ocaml.org/t/how-to-compile-ocaml-program-on-linux-for-running-on-freebsd/12110/4?u=jbeckford
Option 2: If you want a more out-of-the-box solution, you can use my commercial DkSDK native development kit. From an OCaml perspective, it is a OCaml-beginner friendly kit that embeds OCaml into other languages and frameworks. Two short-term things are relevant. 1) The docs mentions C a lot, but only because I haven’t finished writing its FFI. It will support OCaml objects ↔ Objective-C/Swift objects using Apple’s Foundation library. 2) I inadvertently broke support for Xcode builds, but that will get fixed sooner or later (depending on the interest).
Anyway, ping me privately if Objective-C/Swift dev in Xcode with the Run button automatically building FFI-supported OCaml code sounds like a fit.
The Be Sport app is written in OCaml (iOS, Android, Web client and server) with Ocsigen (Eliom, Js_of_ocaml, Ocsigen Start…) as an HTML5 app (with Cordova)
I also use Eliom for our internal mobile application and we are delighted. Very low maintenance, and only one application to write for all platforms. Very easy to use.