Building iOS apps with OCaml?

Couple more options …

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:

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.

1 Like