The . Net derives from the ideas of JAVA.
Sun, which was struggling to cope with many platforms, developed the concept: "Write Once run Everywhere": "write once and run anywhere".
How would it be possible to run the same code on an embedded chip and an x64? The solution at the time (and java to this day is like this), was to abstract the programming language, the developer writes the program in a generic language, this code is compiled in an intermediate bytecode, and this bytecode is distributed.
When running a JAVA program, the java machine (jre, java Runtime Environment, which is platform-specific) converts the bytecode to native code, loads in memory, arrow the execution pointer and ready, you have your native code running on multiple platforms.
In the end you end up having:
1 JAVA compiler.
1 intermediate byte
n Runtime environments (one for each platform)
Instead of having n compilers for each platform.
I really don’t see much advantage in that, from an engineering point of view, compared to having n compilers. Actually there is a setback: programs take longer to start.
Microsoft followed this model, but adapted the content to several languages:
n compilers (one for each language).
1 intermediate language
m Runtime environments (one for each platform)
The advantage of this is having: n+m programs, if you had a compiler for each pair (language, platform) would result in n*m programs.
The one installed on Linux to run applications. Net Core is the Runtime environment, but it is possible to generate a program compiled with built-in Runtime (which generates a very large program).
The Runtime environment calls the native functions when needed and handles operating system pointers and handlers.
There is great anxiety on the part of developers to generate native code from . Net, and this is one of the decision factors when choosing a language/compiler.
I do not have enough information to prepare a response, but mobile, the code is already compiled to target platform, will not be a program . net...
– Rovann Linhalis
@Rovannlinhalis why it is not so on all platforms?
– CypherPotato
Rovannlinhalis is half right. For example: Xamarin.Android bundles IL code ( .NET platform code) together with the specific platform’s Jitter and its dependencies. Thus the code that is in the device is code . NET.
– Jéf Bueno
I do not know if I understood the purpose of the question well. But basically it is the same thing as qqr normal application, is generated "machine code". In the case of Android, IL code is generated that goes bundled with the VM (Mono, I think) and a Jiter. In the case of iOS is generated machine code from the IL code (it was so before, I can not say that it is still). I just don’t know how the issue of memory management works on iOS, since there is no way to have a Garbage Collector. I imagine that the IL -> machine code conversion has something to manage memory. I would need to give a read p/ understand.
– Jéf Bueno