Contemporary Development With Functional Programming

OCaml on iOS 7 Simulator Released

September 8, 2014

Today I’m releasing an OCaml compiler for the iOS 7.1 Simulator. It’s just a small modification of the standard 32-bit Intel OCaml compiler, but I’ve found it helpful and even delightful for developing iOS apps in OCaml.

I affect a bantering tone, but secretly I’m honored that the companion compiler for OCaml on iOS devices recently enjoyed a brief episode of mini-fame in the hacker community. (True meaning of hacker: someone who codes passionately if unwisely.) I hope this effort is also interesting to my hacker brethren and sistren.

OCamlXSim 4.0.1 is a cross-compiling version of OCaml 4.01.0. I’m running it under Xcode 5.1.1 on OS X 10.9.4. You can download a binary installer here:

Voronoi lighthouse looking screen

OCamlXSim 4.0.1 Installer for OS X 10.9

You can get sources from the Subversion repository here:


If you just want to see the differences from the base OCaml 4.01.0 release, the diffs are available here:

OCamlXSim 4.0.1 diffs from OCaml 4.01.0

The changes to the compiler itself are quite small; most of the difficulty is in making it into a cross compiler from OS X to the Simulator environment.

A simple test of the installed compiler is given on Compile OCaml for iOS Simulator. There are also instructions for building from source.

The image above shows the Voronoi app running in the iOS 7.1 Simulator. Perhaps it’s a Pygmalion kind of thing, but I’m always shocked how many beautiful images you can create with this app. I’ll rewrite the Voronoi app for the latest iOS, and I hope at least one other person will have as much fun with it as I do.

A new revision of OCaml (4.02.0) has just come out, and of course there will always be new revisions of everything. I’ll be working on updating everything, but I’d also be happy to farm out work to you, reader, or to any interested parties you might know of.

If you find problems with the compiler, I’d be glad to hear about them. Or if you have any comments or encouragement, leave them below or email me at

Posted by: Jeffrey


blog comments powered by Disqus