Hacker News new | ask | show | jobs
by akiselev 3901 days ago
I don't see why Xamarin wouldn't be detectable but I don't think it would appear as a separate library. Due to the impedance mismatch between C# and ObjC, Xamarin has to generate proxies and wrappers as well as deal with some abstraction leaks.

However, iOS (afaik) doesn't quite have shared libraries like you would have on a Linux server and there's no point in creating a separate ObjC library that would add bloat to each Xamarin binary because the C#-to-ObjC transpiler can selectively generate the wrappers/proxies during compilation. Xamarin might not even use a code generator to do that because you can just include all the ObjC code with the transpiler and copy-paste include them into the project at will.

1 comments

Xamarin on iOS works in a similar way to Unity. They both use the Mono AOT compiler (ahead of time translation) to convert C# to native ARM code. It's not a JIT environment, like on Android. Miguel de Icaza is one of the founders of Xamarin and the Mono OSS project.

However, Mono isn't composed of ObjC classes so it's harder to detect just by looking at that list like the author did here. Xamarin does have a few ObjC components (such as XamarinNSThreadObject) since it adds a support library to the environment.

We actually match the structure of the code (control flow subgraphs), as well as other items like data references, so we get a more accurate view than you do just looking at class names.

You're right that each native or ObjC library you use with Xamarin has a plugin that exports a C# interface. It will be interesting to see how this evolves and if Xamarin will come up with a way of auto-generating these interfaces better.