i came across ahead-of-time (aot) compilation in some writing by Miguel de Icaza about producing applications for iphone using mono. It sounds like what results is native code. Is this so or what is the difference?
views:
310answers:
3AOT compilation is that, Mono will compile methods to native code before the program is run. You can read about it here
Yes, the result is native code, but in the basic AOT version this still needs the Mono runtime to execute.
What happens in the "Mono on iPhone" scenario is a bit more complex. First, the managed libraries are trimmed using Mono Linker. Then the result is compiled to native code with mono --aot=full
. Finally, all this is passed to mkbundle to pack it into a single executable, including the Mono runtime.
If you just want to run .Net applications without installing Microsoft .Net / Mono, then just use mkbundle.
When you use aot=full (only supported on a few platforms) then no code will be JITed at runtime.
But you still require a runtime to provide many of the features that your application uses. Mono's runtime includes support for garbage collection, thread management, the IO-layer, the IOremapping layer, the interface to the operating system, support for the decimal type, reflection (so you can still do things like type.GetMethods () for example).