WinRT: An Object Orientated Replacement for Win32 对于C++开发者是个好消息吧!?
WinRT isn’t another abstraction layer; it resides directly on top of the kernel just like the Win32 API. This marks the first major break in the core of Windows since Win32 was introduced in 1993 with Windows NT. WinRT represents a new application execution environment with semantics that are very different than Win32.
Unlike Win32, which was designed with C in mind, the WinRT APIs are written in C++ and designed from the beginning to be object oriented. Consistency, ease of use, and performance are key aspects of the new runtime API. Every object in the WinRT API supports reflection so that even dynamic languages such as JavaScript can use them efficiently. Along with this comes a unified object model, a rarity for C++ based libraries.
Side note: The Win32 API has not been removed and older applications using the traditional application execution environment will continue to work as expected.
C++ Development
User interfaces in C++ will be written primarily in XAML. This libraries for working with XAML have all been ported to C++ and are compiled to native x86. Metro applications written with XAML and C++ do not run on top of .NET, they get compiled directly to x86 just like any other Visual C++ application.
Calling methods on UI controls is just like calling methods on any other object in C++. At the machine code level one pushes the this pointer onto the stack and then invokes a function via a v-table. This allows for the best possible performance even on low power devices.
Libraries used by modern C++ applications such as Boost are supported.