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
- The solution must be real, there’s a lot of preliminary or prototype work done but..
- I’m using objective C and I really do need Cocoa bindings; because a large amount of my data is using Cocoa types so things would be a mess otherwise. Also objective-c messaging would prevent me from needing to create glue code between static C functions and my Objective-C object instances (which is already what objective-c method calls are doing built-in..)
- The solution must be license-safe for statically linking (iOS requirement)
Here are examples of what I would like to do:
- Process a language of bytes, for instance a network protocol
- Input: bytes and length and ‘calling’ objective-c method instance
- Output: return to calling objective-c method instance, send it cocoa-container arguments
- Make decisions about the best “move” in a board game
- Input: cocoa-contained state data, ‘calling’ objective-c method instance
- Output: possibly alter state data, possibly call an arbitrary objective-c method, and then return to calling objective-c method instance, send it cocoa-container arguments
Gambit or Chicken Scheme are probably your best bet — they compile to C.