Mono 3.2 is a major update to the Xamarin platform and brings C# 5.0 to all its supported platforms, including Android and iOS. The gives mobile developers the async and await keywords that simplify the creation of responsive user experiences.
Writing on the Xamarin blog, Miguel de Icaza, who has run the Mono project since its creation in 2011, explains why this is such an advantage:
Until today, the only option for you to build responsive apps that work around network delays, connectivity issues, and complex data queries and processing is to use traditional asynchronous programming techniques. While leveraging common asynchronous patterns would lead to a better app for your users, they are not easy on the developer. You can quickly end up in a situation where your code has a cascade of nested callbacks that make it difficult to debug problems and create more opportunities for error. Even worse, sometimes the complexity is such that developers tend to cut corners on some code paths, leading to suboptimal experiences when applications are used in the wild.
The async and await keywords in C# 5.0 now available to Xamarin developers make asynchronous programming incredibly pleasant. You end up with code that is much more linear and much easier to understand. The compiler does a lot of magic for you which simplifies your code and your life.
In addition to C# 5.0 async, this Xamarin update also upgrades Xamarin’s Mono to 3.0 for Xamarin.Android, Xamarin.Mac and Xamarin.iOS, giving them the benefit of changes to Mono made over the past two years. These improvements include new .Net 4.5 APIs, async-friendly System.Net.Http, better debugging support, a faster version of our garbage collector and an improved way of dealing with generics on iOS devices.
Other highlights of the release are:
Runtime - LLVM updated to version 3.2 for better optimizations
Garbage Collector - Mono now defaults to the SGen Garbage Collector, its the best performing and most stable release
Low pause mode - in this mode, SGen executes major collections concurrently with applications only briefly pauses to complete it
Low promotion nursery - employs aging to reduce temporal effects on object promotion and reduce the pressure on the major heap
Mostly precise stack scanning - speeds up collections by reducing the volume of conservative scanning needed; reduces pinning, leading to shorter minor collection pause times and increased space usage of the nursery.
Size Reduction - multiple features can be disabled for the classlibs to reduce the footprint on mobile devices. FullAOT targets now enjoy much better fallbacks and much more linker friendly code.
Performance - the FullAOT compiler can now generate much faster code for icalls and has support for generic valuetype sharing, ending once for all issues with missing methods at runtime.
- Performance of primitive parsing greatly enhanced.
- LINQ is now much faster with arrays.
- Large object cloning and boxing is up to two times faster.
- Optimize Marshal.Read/Write methods to avoid a trip to unmanaged when possible.
You can appreciate that all of the improvements are deep implementation changes. What else could there be to talk about given that Mono has to follow Microsoft's lead. What is really interesting is what will happen now that Mono has caught up with the latest Microsoft version of C#. Will Mono start to innovate in the language as well as its implementation? Given that Microsoft has revealed that there will be no updates to the language in Visual Studio 2013 and the move to Roslyn compiler for the next version probably means a few years of comparative language stagnation.
See the release notes for Xamarin.iOS and Xamarin.Android for all of the details.