Search code examples
iphonef#monoxamarin.iosironruby

Alternative languages with MonoTouch


MonoTouch is always mentioned along with C#. Are the framework and toolset actually limited to C#, or do other CLR languages like IronRuby and F# work as well?


Solution

  • It's not limited to C#, but there are a few caveats to running other languages:

    • dynamic code generation (reflection emit) isn't possible on iPhone, so IronPython and IronRuby won't work
    • if the compiler generates code that depends on APIs that don't exist on MonoTouch, such as the VB.NET runtime library, those APIs/libraries will need to be ported
    • The compiler must be able to target a custom framework/corlib - though MonoTouch's core fx is the same as silverlight, so any SL-targeting compiler should work out of the box. I'm sure you could do some trivial retargetting of assembly references with a tool such as Cecil too.

    Delphi Prism is known to work - their MonoDevelop addin even has MonoTouch support. Other statically compiled .NET languages should generally be fairly easy to port.