Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 965
Chuck Avatar asked Dec 10 '09 20:12

Chuck


People also ask

What languages support Xamarin?

The language(s) supported in Xamarin development is/are Java C# Kotlin C# and F# A 10 out of 20 answered.

What can I do with Xamarin?

Xamarin enables developers to write code for native Android, iOS, and Windows applications from within Visual Studio or Xamarin Studio, as well as build mobile user interfaces (UI), all in a single language - C#.

Is Xamarin hybrid or native?

Xamarin is an open-source, c# . NET based, cross-platform mobile apps development framework to develop truly native apps for iOS, Android or Windows. It builds native apps with high performance and native UI. It has access to platform-specific native APIs for each platform like iOS, Android or Windows.

Is Xamarin native?

Xamarin Native is a set of Xamarin's native tools for app development. The platform has individual tools for Android, iOS, and Windows development.


2 Answers

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.

like image 137
Mikayla Hutchinson Avatar answered Oct 16 '22 08:10

Mikayla Hutchinson


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.

like image 23
Stringer Avatar answered Oct 16 '22 08:10

Stringer