Alternative languages with MonoTouch
Asked Answered
E

2

10

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?

Emiliaemiliaromagna answered 10/12, 2009 at 20:47 Comment(0)
F
12

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.

Fructuous answered 10/12, 2009 at 22:25 Comment(0)
F
3

Novell is kinda vague on this point, they say: "MonoTouch is a software development kit for Mac OS X that lets you use .NET programming languages".

It seems that simple F# programs like Hello-world are working, see this post: http://jamesmoorecode.blogspot.com/2009/09/f-running-on-iphone.html

And because IronRuby is built on top of the DLR and since Novell do not support the DLR for MonoTouch, IronRuby should not work.

Filaria answered 10/12, 2009 at 21:8 Comment(2)
Thanks for your very helpful answer. I +1'd.Emiliaemiliaromagna
To make things a little easier for F# inside MonoDevelop, I just posted a rakefile at git://github.com/banshee/fsharp_rakefile.gitAraminta

© 2022 - 2024 — McMap. All rights reserved.