BT

New Early adopter or innovator? InfoQ has been working on some new features for you. Learn more

Xamarin Introduces C# Async for iOS and Android

| by Jonathan Allen Follow 31 Followers on Mar 12, 2013. Estimated reading time: 1 minute |

Xamarin has released a preview of their async-enabled libraries for iOS and Android development. This work is based heavily on Microsoft’s .NET 4.5, which was released late last year as part of Visual Studio 2012. Xamarin is the new name for the development platforms previously known as MonoTouch and Mono for Android.

As part of the Xamarin 2.0 initiative, the mobile platforms have adopted the class libraries found in Mono and .NET. Previously MonoTouch and Mono for Android were restricted to a subset based on Silverlight/Moonlight. Rodrigo Kumpera writes,

While asynchronicity is the main theme of this release, we also pack two years of improvements to the Mono runtime spread over more than 7,000 individual commits that are now available to Android, Mac and iOS users.

This release also brings with it improvements to the iOS batch compiler. Unlike most other platforms, iOS doesn’t allow for JIT-compiled code. This has led to problems with dynamically invoked code, especially where generics are involved.

On iOS we now generate “shareable code” for value types, a truly revolutionary innovation in code generation technology. In practical terms this means that a whole range of code that previously crashed with a “Attempting to JIT compile method” now works. While we still provide the high-performance, and fine-tuned generic code that we can infer –for example direct calls to a method Foo<T>(T x)– we generate a value-type shared version of Foo<T>(T x) that can be used in dynamic cases that previously failed. What was once a dream, is now a reality.

Currently Microsoft’s .NET own JIT compiler doesn’t have this capability. While it will share one method for all reference-types, a generic method has to be re-compiled for each distinct value type.

Variance and Contravariance support, introduced in .NET 4.0, has also found its way into the Xamarin platform.

Rate this Article

Adoption Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and don't miss out on content that matters to you

BT