The new development platform for so-called Metro apps is called WinRT, short for Windows Runtime. Its name suggests its potential future place as the principal runtime library for Windows. Developers who have already embraced the .NET Framework may find themselves shifting positions to make room.
WinRT is not the replacement for .NET. However, as Microsoft Windows engineer Ale Hole?ek told a press gathering at Build 2011 in Anaheim, it will present a new foundation for an alternative app model for Windows that Microsoft will promote as the modern style of Windows development.
“Developers will be able to make a choice as to the best way to solve a task at hand,” Hole?ek told the conference. He’s referring to the two application development models which will co-exist in Windows 8, and we’re told, thereafter. However, based on an early peek at a developers’ preview of Visual Studio Express specially geared for Metro, it appears JavaScript apps (not “JS” or “Visual JS,” as Microsoft once called it during the heady days of battling Netscape) will take center stage among VS projects, right alongside the .NET languages Visual Basic, Visual C#, and Visual C++.
Traditional .NET language-based development involves laying out the application using XAML, Microsoft’s XML-based resource description language. All of .NET’s managed code may use XAML to determine the layout of windows, controls, and graphic objects. But HTML5 is intended to be cross-platform. As such, Web apps based in HTML5 use CSS for their layout and style, and JavaScript for their functionality.
As RWW saw in demonstrations here this week, Metro apps designed to be integrated with Windows 8’s new Start Screen can be developed without .NET and without XAML, using CSS and HTML5 instead. (Whether the word “pure” applies to either one will be determined by testing.) Although this Web-oriented model utilizes Internet Explorer libraries for rendering, these apps don’t appear in the browser itself. Like Silverlight apps, Metro HTML5 apps can stand alone, as can Metro XAML apps.
But Silverlight itself starts to play less of a factor, as WinRT takes over the role of providing system services to the application. Silverlight has been Microsoft’s initial effort to produce a subset of the .NET Framework that could conceivably be deployed cross-platform, though it’s fallen to the shoulders of open source developers such as Miguel de Icaza to do it for Linux and Mac.
Although the tools a Windows 8 developer will use to make Metro apps are Web standards-based, the library calls themselves are obviously directed towards Windows. For example, the JavaScript instruction that invokes a new variable representing a function of the WinRT library begins with the keyword var
, then the variable name and =
, followed by new
and the library root name Windows.
As Hole?ek made clear, Silverlight is not going away. His prophetic statement, “We will preserve all of their investments,” referring to developed Silverlight apps, does indicate it might not be going very far forward.
Engineers showed that future tools will enable developers to endow existing Silverlight apps with a coat of paint, if you will, giving them a Metro-like style. But that’s as far as it goes – “Metro-like.” The jump from Silverlight to WinRT (if it’s worth doing rather than just starting over) requires a rewiring of existing apps. The reasons are technical, though perhaps unyielding: 1) The namespaces required by Silverlight and Metro apps are different, by virtue of Metro’s reliance upon WinRT; 2) Silverlight relies on the browser (IE) to provide networking code, while WinRT relies on underlying system services; 3) Silverlight assumes the browser is present but invisible, so it still sends navigation commands to IE, while WinRT manages navigation through system methods.
Microsoft continues to work with the W3C standards agency, he added, to integrate new controls such as the “grid” and “flex-box” used in Win8, into HTML5. The company is instrumental, he said, in helping to evolve HTML5 with services such as secure local storage and WebSockets for asynchronous communication.
But the one certain way Microsoft can prevent WinRT from being used by a Web-based app to mock a system service or device driver, the engineer said, was to simply prevent WinRT from being used for these purposes. There will be no WinRT-based device drivers. That may make it difficult for device driver makers to implement contracts, to invoke the new term, for the new Settings menu in Metro. Difficult but not impossible, as Microsoft demonstrated one working Print Preview app in Metro, built by HP.