EDIT: After spending several hours researching this, I don't think I'm going to find anything that will actually end up saving me time compared to the amount of time and effort of finding suitable language, suitable bindings, and maintaining that environment in the face of change on all these platforms. I'm accepting the answer that seems most realistic because it would be the best idea for most people. The opinion I'm drawing from these conversations and others I'm having is that the only true way forward is to either use a Functional language that can operate without external bindings, or something that has bindings maintained by a commercial entity such as F#. It's too much work and too little demand and the state of what's available in the wild reflects that. I hope it changes one day.
I'd like to start using a functional language in my software, in addition to Objective-C which is my primary language (C may be workable as the binding?). Must be cross-platform, meaning Windows, Linux, OSX (x86), and iOS (ARM). What should I use and how can I achieve this?
I'm planning to switch to LLVM backend and Clang for my Objective-C soon, if this makes any difference.
I don't have any "knowledge investment" in any functional language, although I've screwed around with a few. I'm learning one from scratch so I want to learn something non-arcane if possible
Here are examples of what I would like to do:
As Daniel Bünzli mentions, we have an OCaml iPhone app that's for sale right now in the iPhone app store. (It's a card game named Cassino, if you want to look for it.) Apple dropped their language restrictions in September 2010, and we encountered no resistance from them whatsoever (though of course we are a very small player).
I put together some tutorial examples for writing iOS apps in OCaml that you can find at our website:
http://psellos.com/ocaml/example-app-portland.html
http://psellos.com/ocaml/example-app-slide24.html
You don't mention whether you want GUI code to be cross platform. That's a much harder problem. Our code uses thin wrappers to access the native Cocoa Touch libraries, which aren't going to work on Linux or Windows. They do work (at least a subset) on OS X. You can see some custom (much simplified) Cocoa Touch wrappers in the tutorial examples.
OCaml certainly works well on all the systems you mention. It seems like a pretty good choice to me (a somewhat biased OCaml enthusiast).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With