views:

310

answers:

3

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?

+1  A: 

AOT compilation is that, Mono will compile methods to native code before the program is run. You can read about it here

Aragorn
Thanks for the link, if the AOT=Full option is used is it the case that all dependencies on a runtime are removed and the resultant code is unmanaged? Sorry if this is a dumb question
jjb
ie that the code can be run on a machine without mono?
jjb
the code is compiled to native code but it stills needs the libraries.
Aragorn
+2  A: 

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.

skolima
Thank you that helps me to understand it better
jjb
+4  A: 

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).

miguel.de.icaza
OK I think I get it thanks, it's native code with a runtime, a little analagous with vb6 in that regard, perhaps
jjb