I'm experimenting with making a cross-platform library (specifically for iOS and Android) and I'm curious to hear what languages other people who have done it ended up using.
The most obvious first thought is C++. I've only lightly dabbled in it, and the most frequent opinion I hear is that C++ is more "necessary evil" than "a delight to work with". So I started looking at alternatives, having used none of them before.
Go has built-in functionality to make Go code callable from Objective C and Java. But it's still the Go runtime underneath, just proxied out to native.
By comparison, Haxe can output both C++ and Java. Presumably it has some cleverness built into C++ to handle garbage collection, but it sounds like the output is more "pure" than Go would be.
But does that even matter? Haxe definitely feels like a more familiar language to write, but a more obscure language in terms of raw popularity (but it has generics!). Go feels more alien (and I'm concerned that it doesn't seem to let you explicitly handle threads, which has bitten me on iOS before), but everything I'm reading about how it's structured, testing etc. just feels very sensible.
Has anyone used any of these options to make a cross-platform library? Or is there another one I haven't thought of? I'm curious to hear any experiences.
I also have not run into any task yet I haven’t been able to accomplish in C++ (threading, etc is well documented and you have a few options)
I’ve actually written a UI framework on top of Cocos2d-x (essentially C++ and OpenGL) which we use in production that has also been robust and allows us to just write it once and compile for iOS and Android.
C++ is definitely verbose but it is also very flexible and IMHO.