Hacker News new | past | comments | ask | show | jobs | submit login

I'm curious how it integrates Mono runtime into a "native ARM executable". The whole runtime must be really big. When building the App, does it only integrates the parts required to support the App, or does it integrate all?

The other question is that, when running on iOS, is it the .NET IL running on top of the runtime, or C# code is compiled into native binary code that can be directly executed on CPU? I'm trying to figure out if there's something like a micro VM running.




We wrote the equivalent of a linker, which only brings the pieces that you actually reference.

http://docs.xamarin.com/guides/ios/advanced_topics/linker


Dunno, but the android ones are pretty big. A simple 'hello world' view:

    ls -sl ~/Desktop/HelloWorld.apk
    10144 -rw-r--r--  1 doug  core  5191787 20 Feb 23:46 /Users/doug/Desktop/HelloWorld.apk


Most Apps are not as simple as a "hello world" view. My guess is that, the getting-started pack is large but when you add more things into it, it doesn't increase that much.


Short answer: it gets converted to native, they can actually determine which parts of the .NET runtime you are using and only fold those elements in which makes the IPA pretty small actually.

There is no virtual machine.


Thanks. That sounds pretty cool! Where does the conversion happen? Does it compile C# directly to target code, or it converts from .NET IL?


C# is compiler to IL.

The IL linker operates over the IL code (typically C# produced, but we are working now on adding also F#) and produces the minimal set needed to run.

Then we compile the resulting linked IL to ARM code, and then we run the result using the C linker (so the same removal of unused code takes place, this time for the C bits of Mono).


That's neat. Just downloaded the installer and I'm gonna give it a try later today. Good job!




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: