Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does mono compile C# and to native?

I'm new to Mono and just started recently. Is mono program are compiled from C# to native code to be able to run on several OS?

and also, I saw a screencast on MonoTouch, which tells me that the monotouch (particularly) compile everything down to Native for C# to be able to run on Iphone.

Im quite confuse.

like image 909
DucDigital Avatar asked Feb 24 '10 03:02

DucDigital


People also ask

Is Mono a compiler?

The Mono C# compiler is considered feature complete for C# 1.0, C# 2.0, C# 3.0, C# 4.0, C# 5.0 and C# 6.0 (ECMA) and it has partial support for C# 7. Historically, various version of same compiler existed.

Does Mono compile to native code?

Mono by default compiles to an intermediate bytecode, which is then run on a virtual machine. This byte-code is portable but is not native machine code.

Can Mono run .NET framework?

So, after all these years of its evolution, mono is capable of running many of original . NET Framework application types on operating systems other than Windows. This includes GUI-enabled desktop applications, which can now be made compatible with virtually any modern desktop operating system, including Solaris.

What is the compiler for C#?

Visual Studio - Windows only Visual Studio is the compiler and IDE created by Microsoft for Windows computers. Visual Studio has several versions. The professional version can compile C# code, as well as a number of other languages.


2 Answers

Mono by default compiles to an intermediate bytecode, which is then run on a virtual machine. This byte-code is portable but is not native machine code.

Mono does have an AOT compiler that will produce native images for when bytecode is not an option.

like image 79
Jimmy Avatar answered Sep 24 '22 00:09

Jimmy


Pretty much all .NET platforms, both Microsoft (including desktop, compact framework, and microframework) and third-party (such as mono) compile everything first to a common intermediate language which is portable, then just-in-time compile during execution to native code. Some have no JIT and simply interpret the IL directly.

Native code is obviously non-portable.

Does that help?

like image 35
Ben Voigt Avatar answered Sep 26 '22 00:09

Ben Voigt