# Monday, 10 October 2011
« New Development Snapshot | Main | New Development Snapshot »
Windows Runtime (aka WinRT) Thoughts


After the Build keynote many people were confused. I think there were three main reasons for that: 1) Metro Style Apps and Windows Runtime APIs were introduced together, 2) marketing had banned the mention of COM and 3) Windows Runtime is a bad name.

As the conference progressed and people had time to ask more questions and attend more sessions things became a bit clearer. If you haven't already done so, please read Miguel's blog entry about WinRT.

Let's dive deeper into the three points of confusion:

  1. Metro Style Apps and Windows Runtime are two orthogonal concepts.
    I expect some people to take issue with this, but the reality is that Metro is a new application model and WinRT is a new way of exposing Windows APIs. They are completely orthogonal. To be clear, most new WinRT APIs are only usuable from Metro Style Apps, but that is simply a consequence of the fact that many new APIs were added to support Metro and WinRT is the obvious way to do it.
    It should be obvious by now, but I'll explicitly mention it. Some WinRT APIs are usable from non-Metro apps and some Win32 APIs are useable from Metro apps.
  2. WinRT is an evolution of COM. IMO, if they had mentioned this during the keynote, there would have been a lot less confusion. However, marketing had apparently found that people don't like COM and so it was decided that this should not be mentioned, of course during subsequent talks it quickly became obvious anyway.
  3. The Runtime in "Windows Runtime" is like the Runtime in "C runtime library", not like the Runtime in "Common Language Runtime". The Windows Runtime is not an execution environment, just a set of APIs and a way of exposing these APIs (and your own APIs using a similar mechanism).

What About .NET?

Like COM, Windows Runtime APIs can be used from different languages (but the language needs to do some work to enable this). Microsoft supports using WinRT APIs from C/C++, Javascript and C#/VB. All of these languages were modified to support this. Not all .NET languages automatically get full support for WinRT, for example there is currently no first class WinRT support in F#.

Some people thought that .NET was going to be replaced by WinRT (probably due to reason 3 above), but this clearly doesn't make sense.

Something of interest from a .NET point of view is that instead of type libraries WinRT uses the .NET (ECMA CLI) metadata format to describe the APIs. I made a couple of minor tweaks to IKVM.Reflection to better support this.

What About IKVM.NET?

I have not yet investigated exactly what is needed for WinRT support in IKVM.NET, but it is very likely that WinRT support will arrive some time before Windows 8 is released.

Note however that running IKVM.NET inside Metro Style Apps will not be supported, because the .NET Metro profile is very limited. Hopefully more about this in a future blog entry.

Recommended Viewing

Lap around the Windows Runtime
Windows Runtime internals: understanding "Hello World"
Ten Tips When Writing a Hybrid Language Metro style Application (this title is very misleading, it really is about the design of WinRT)

Monday, 10 October 2011 11:10:17 (W. Europe Daylight Time, UTC+02:00)  #    Comments [1]
Thursday, 21 June 2012 09:38:55 (W. Europe Daylight Time, UTC+02:00)
Random question - you mention some possibility of IKVM.Reflection in the context of WinRT. Any chance you had time to look at this? In particular, what would be awesome is if, on **REGULAR** .NET, I could emit a WinRT assembly.

Context: I maintain a few libraries that are extensively meta-programming based. On WinRT, my options are:

1: use reflection at runtime, slow
2: pre-generate an assembly (perhaps as a build step) that can be referenced and included - something akin to "sgen.exe"
3: re-write my entire code-base

Obviously, #2 is what I'm hoping IKVM might be able to help me do.
Home page

I apologize for the lameness of this, but the comment spam was driving me nuts. In order to be able to post a comment, you need to answer a simple question. Hopefully this question is easy enough not to annoy serious commenters, but hard enough to keep the spammers away.

Anti-Spam Question: What method on java.lang.System returns an object's original hashcode (i.e. the one that would be returned by java.lang.Object.hashCode() if it wasn't overridden)? (case is significant)

Comment (HTML not allowed)  

Live Comment Preview