What is the WinRT (Windows Runtime) and what does it have to do with .NET?

DevExpress Data Blog
23 September 2011

There has been a lot of confusion engendered by this infamous architecture drawing (slides courtesy of Microsoft):

Windows 8 Architecture

If you zoom in some you should see something like this:

WinRT Architecture Missing Bits

For some reason this architecture diagram left out the all-important notion called the Projection. The main idea is that each of the technologies used to plug into the WinRT do not directly call the WinRT but work through a binding called a projection (yes even the C/C++ side). So what is this Chakra business then on the JavaScript side? This is simply the code name for the JavaScript engine that maps to the projection. For C#/VB it goes through a profiled version of the CLR. If you are unsure about what a .NET profile is, here is a reminder picture that jogged my memory:

.NET Profiles

When you look at project properties you have different profiles that can be used as targets to your program. In Silverlight you have a similar thing:

Silverlight Profiles

The best analogy for Metro (at least from the XAML/C# and VB side) is actually Silverlight. A subset of the namespaces we are used to will be available with a strict emphasis on asynchronous unless otherwise stated. For those familiar with WP7 (which is the closest namespace-wise) there have also been some renaming of namespaces (see msdn for more info). The C/C++ side has a thin projection (which theoretically should not be faster than the other projections but I have my doubts here). The better diagram:

Better Windows 8 Architecture Diagram

The green bits represent the WinRT and the orange part represents the projection. Every object in the WinRT has the IInspectable and IUnknown interfaces (sound familiar?). The way they are pushed up is a bit different.

WinRT Projections in Depth

The key information that’s been added is the Windows Metadata. This portion is what allows the rich intellisense in Visual Studio 11. Now the C++ projection (as far as I understand) does all the binding (ok, projection) stuff at compile time. For the C#/VB apps the story is a bit different. Some of the projection/binding happens at compile time and some happens at runtime. We are being told, however, that this is negligible (hence my doubts).

Mehul and I chatted a bit about the WinRT on our recap video at the //BUILD/ conference. Notice that when I talk about the WinRT I specifically say that it is not .NET. Hopefully the discussion we had helped clear this up! This does not mean that we cannot write .NET code on top of the WinRT. This is done via the projection mechanism discussed.

I plan to do similar posts (I’ve been chewing my arm off trying to talk about this stuff!) on the WinRT especially when it comes with the namespaces and classes and what exactly has been exposed to the developers.

I would love your take on the matter! Also, I have been known to make mistakes. Let me know if you find any glaring ones so I can correct them!

As always, if there are any comments and/or questions, feel free to get a hold of me!

Seth Juarez
Email: sethj@devexpress.com
Twitter: @SethJuarez

Want The Best Reporting Tool Ever?

Get The No-Compromise Reporting Tool for WinForms, ASP.NET, Silverlight and WPF! - Native integration with DevExpress WinForms and ASP.NET Controls, unequalled design-time productivity, industrial-grade features. Try a fully-functional version of DXperience for free now: http://www.devexpress.com/Downloads/NET/

Let us know what you think of our Reporting Suite by rating it in the VS Gallery!

Follow SethJuarez on Twitter

Free DevExpress Products - Get Your Copy Today

The following free DevExpress product offers remain available. Should you have any questions about the free offers below, please submit a ticket via the DevExpress Support Center at your convenience. We'll be happy to follow-up.
No Comments

Please login or register to post comments.