Mani Ramaswamy and Peter Sollich: Inside Compiler in the Cloud and MDIL

Play Mani Ramaswamy and Peter Sollich: Inside Compiler in the Cloud and MDIL
Sign in to queue


By now you've learned that the CLR, Windows Phone Client, and Windows Phone Services teams got together to develop "Compiler in the Cloud". All Windows Phone 8 apps written in .NET technologies will get the benefit of this collaboration. The end goal? Really fast startup of Windows Phone 8 .NET apps.

"Compiler in the Cloud?", you ask. 

The idea is pretty simple. First, enter MDIL or Machine Dependent Intermediate Language or .NET hybrid assembly language. MDIL is all about compiling to native assembly instructions whenever possible, and compile the rest to pseudo instructions that can quickly be translated to native instructions on the phone. Thus, this assembly containing a mix of pseudo instructions and native instructions can be shipped to the device (and is portable across the same architecture - example, across all the ARM devices), and on the device we perform a light-weight linking step to convert the entire assembly to a native image. Most of the heavy lifting is done when we compile the IL assembly to the intermediate file between an IL assembly and a native image (this is what MDIL is).

"So what?", you ask. The linking step on the device that converts MDIL assembly to a native image only takes 1/5th the time as traditional NGEN on device. Thus, we get some of the benefits of both pre-compilation (since we are executing off the native image where all instructions are assembly instructions) and JIT-compilation (no heavy compilation on the device during framework updates).

Tune in to meet the program manager for code generation in .NET, Subramanian (Mani) Ramaswamy, and one of the lead developers of "Compiler in the Cloud", Peter Sollich. Peter is an expert in precompilation. We go quite deep here with plenty of whiteboarding. Peter teaches us exactly what MDIL is and why it's designed the way it is. We also talk about the higher level meaning in this (apps start fast, at native speed!). All around, it's a great Going Deep episode. Take the time to watch and learn. Thanks Mani and Peter!!

See Subramanian's BUILD 2012 session where he goes into detail on MDIL/Compiler in the Cloud and other performance/functionality improvement in .NET for Windows Phone 8.



Download this episode

The Discussion

  • User profile image

    NICE !

    Now we need this on the Windows 8/RT and desktop CLR !

    IIRC Peter Sollich was an old Borlander, master of Delphi compiler, an old college of Anders, and he owns the patent of MDIL Devil

    btw, nice to see something in Bartok stuff appears in the normal CLR, Tongue Out

  • User profile image

    Any idea why the CLR team came up with Auto NGEN for the desktop instead ? I think this should be the way forward atleast for the .Net WinRT( Metro) apps. IIRC auto ngen is done using a on device maintenance task , so though the subsequent startups may be faster the initial startup would always be slower. 

  • User profile image

    Hmmm... Peter Sollich mentioned that the next step should be a 'slower but better optimized compiler', guess that vision may have something to do with this ?

  • User profile image


    Compilers evolve, dude.


  • User profile image

    Great technology. It will be very interesting to hear about phase two, when it arrives, which is the improved optimization in the cloud. It's also cool to think about application updates arriving automatically without the interaction of the developer because an improved compiler yields improved performance. So the end user could see messages like "applications updated with improved performance". That must be a pretty motivating thought for the team.

  • User profile image

    Great talk.

    Will we ever be able to get a proper native code compiler for .NET or must we rely in projects like Mono?


  • User profile image

    I've built a tool to analyse the MDIL assemblies

    MDILDump :

    It's based on the docs in those patents, hope its helpful for people interested. Tongue Out

  • User profile image

    Very interesting

    However it was very hard to recognize a half of Mani Ramaswamy's speech Perplexed

    Please, speak more distinctly at least when it is recorded to watch worldwide

Add Your 2 Cents