Hacker News new | ask | show | jobs
by mwcampbell 3705 days ago
Now my only remaining qualm with Xamarin is this: Having two garbage-collected environments interacting within the same program, as is the case with Xamarin on Android, just seems pathologically complex. Does anyone have enough experience with Xamarin on Android to know if this is ever a problem in practice?

Edit: I wonder if the Xamarin.Android developers ever considered compiling CIL to JVM bytecode (which would then be compiled to Dex bytecode), then reimplementing mscorlib on top of the Java standard libraries. So basically, IKVM.NET in reverse. Then there'd be no bridging between two environments.

2 comments

Recommended watching for iOS and Android - https://www.youtube.com/watch?v=VJsmrTQWD2k simple to identify these problems once you know of them. I keep coming across implementations that make some very fatal mistakes about resource management, notably these problems would potentially also happen when not using Xamarin as well (developers not reading documentation/being careful with allocations)

With Android the most common mistake is cross-heap references, putting a large C# array into a java arrayadapter for example will result in objects that live in both worlds which makes it expensive for Java to see the C# object and C# to see the Java object. The objects are effectively being mirrored, the solution is to use C# all the way down. Where the object was created defines ownership, for example ArrayAdapter containing C# objects means owned by Java with overhead for Java to bridge the C# objects.

That's what RemObjects does.
Yep, I've thoroughly studied RemObjects Elements and seriously considered using it. But it doesn't have nearly as big a standard library or surrounding ecosystem as .NET and Xamarin.