Windows 8 and the future of XAML: The Windows Runtime (WinRT)


What is Windows Runtime (WinRT)?

WinRT is a new programming model/framework that enables us to build Metro style apps using the language of our choice, be that a managed language (C# or VB.NET), C++ or JavaScript. It enables developers to build applications that heavily use functionality exposed by Windows, which was previously difficult to achieve.

Image: Windows 8 diagram, shown at BUILD

image

Note here that WinRT sits right on top of Windows as a thin layer, exposing functions of Windows. These functions can be used in Metro style apps from all languages. In this context, Microsoft speaks of a language projection, which makes it possible to use WinRT in a way that is native to the language. For .NET developers, using WinRT is very similar to writing .NET code. Concepts such as constructors, properties, async development and many more are exactly the same when writing Metro style apps based on WinRT.

WinRT exposes quite a lot of functions to Metro style apps. A lot of things that we are used to doing by writing some .NET code is now covered by WinRT. Things like IO, service access and even XAML itself has now become a part of WinRT. In quite a few places though, including in XAML, you won’t even notice that you aren’t writing .NET code.

Image: The functions covered by WinRT (this image comes from slides shown at BUILD).

clip_image004[1]_434e4713-b003-41f8-862b-3f235061fa45

WinRT Architecture

Image: An overview of the architecture of WinRT

iiii

Windows Metadata
The Windows Metadata is depicted on the left in the picture above. Windows Metadata (aka WinMD) refers to metadata files, similar to metadata for assemblies we have in .NET (a self-describing assembly). In WinRT, WinMD is conceptually the same: it describes what a WinRT component can do. It’s different in that it’s a separate file (whereas in .NET, metadata is included in the assembly itself). WinMD files are present on every installation of Windows 8 and they form the base of IntelliSense when writing Metro style apps in Visual Studio.

To find out more technical concepts surrounding the development of WinRT like what is language projection, the runtime broker, being async and what’s in WinRT, please click here.

Comments (0)

Skip to main content