HOME

TheInfoList



OR:

Windows Runtime (WinRT) is a platform-agnostic component and application architecture first introduced in
Windows 8 Windows 8 is a major release of the Windows NT operating system developed by Microsoft. It was released to manufacturing on August 1, 2012; it was subsequently made available for download via MSDN and TechNet on August 15, 2012, and later to ...
and
Windows Server 2012 Windows Server 2012, codenamed "Windows Server 8", is the sixth version of the Windows Server operating system by Microsoft, as part of the Windows NT family of operating systems. It is the server version of Windows based on Windows 8 and succe ...
in 2012. It is implemented in C++ and officially supports development in
C++ C++ (pronounced "C plus plus") is a high-level general-purpose programming language created by Danish computer scientist Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significan ...
(via C++/WinRT,
C++/CX C++/CX ''(C++ component extensions)'' is a language projection for Microsoft's Windows Runtime platform. It takes the form of a language extension for C++ compilers, and it enables C++ programmers to write programs that call Windows Runtime (WinRT) ...
or WRL), Rust/WinRT, Python/WinRT,
JavaScript JavaScript (), often abbreviated as JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. As of 2022, 98% of websites use JavaScript on the client side for webpage behavior, of ...
-
TypeScript TypeScript is a free and open source programming language developed and maintained by Microsoft. It is a strict syntactical superset of JavaScript and adds optional static typing to the language. It is designed for the development of large app ...
, and the
managed code Managed code is computer program code that requires and will execute only under the management of a Common Language Infrastructure (CLI); Virtual Execution System (VES); virtual machine, e.g. .NET, CoreFX, or .NET Framework; Common Language Runt ...
languages C# and
Visual Basic .NET Visual Basic, originally called Visual Basic .NET (VB.NET), is a multi-paradigm, object-oriented programming language, implemented on .NET, Mono, and the .NET Framework. Microsoft launched VB.NET in 2002 as the successor to its original Visua ...
(VB.NET). WinRT is not a runtime in a traditional sense but rather a language-independent
application binary interface In computer software, an application binary interface (ABI) is an interface between two binary program modules. Often, one of these modules is a library or operating system facility, and the other is a program that is being run by a user. An ...
based on
COM Com or COM may refer to: Computing * COM (hardware interface), a serial port interface on IBM PC-compatible computers * COM file, or .com file, short for "command", a file extension for an executable file in MS-DOS * .com, an Internet top-level d ...
to allow APIs to be consumed from multiple languages, with services usually provided by a full-blown runtime, such as type activation. Apps using the Windows Runtime may run inside a sandboxed environment to allow greater security and stability and can natively support both x86 and ARM. WinRT components are designed with interoperability among multiple languages and APIs in mind, including native, managed and scripting languages. Built-in APIs provided by Windows which use the WinRT ABI are commonly known as WinRT APIs; however, anyone can use the WinRT ABI for their own APIs.


Technology

WinRT is implemented in the programming language
C++ C++ (pronounced "C plus plus") is a high-level general-purpose programming language created by Danish computer scientist Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significan ...
and is
object-oriented Object-oriented programming (OOP) is a programming paradigm based on the concept of "objects", which can contain data and code. The data is in the form of fields (often known as attributes or ''properties''), and the code is in the form of ...
by design. Its underlying technology, the
Windows API The Windows API, informally WinAPI, is Microsoft's core set of application programming interfaces (APIs) available in the Microsoft Windows operating systems. The name Windows API collectively refers to several different platform implementations th ...
(Win32 API), is written mostly in the language C. It is an unmanaged
application binary interface In computer software, an application binary interface (ABI) is an interface between two binary program modules. Often, one of these modules is a library or operating system facility, and the other is a program that is being run by a user. An ...
based on Component Object Model (COM) that allows interfacing from multiple languages, as does COM. However, the API definitions are stored in .winmd files, which are encoded in ECMA 335 metadata format, which
.NET Framework The .NET Framework (pronounced as "''dot net"'') is a proprietary software framework developed by Microsoft that runs primarily on Microsoft Windows. It was the predominant implementation of the Common Language Infrastructure (CLI) until bein ...
also uses with a few modifications. For WinRT components implemented in native code, the metadata file only contains the definition of methods, classes, interfaces and enumerations and the implementation is provided in a separate DLL. This common metadata format makes it easier to consume WinRT APIs from .NET apps with simpler syntax than P/Invoke. Windows provides a set of built-in APIs which are built on the WinRT ABI which provide everything from the XAML-based WinUI library and device access such as camera, microphone etc... The previous
C++/CX C++/CX ''(C++ component extensions)'' is a language projection for Microsoft's Windows Runtime platform. It takes the form of a language extension for C++ compilers, and it enables C++ programmers to write programs that call Windows Runtime (WinRT) ...
(Component Extensions) language, which borrows some
C++/CLI C++/CLI is a variant of the C++ programming language, modified for Common Language Infrastructure. It has been part of Visual Studio 2005 and later, and provides interoperability with other .NET languages such as C#. Microsoft created C++/CLI ...
syntax, was introduced for writing and consuming WinRT components with less
glue code Adhesive, also known as glue, cement, mucilage, or paste, is any non-metallic substance applied to one or both surfaces of two separate items that binds them together and resists their separation. The use of adhesives offers certain advant ...
visible to the programmer, relative to classic COM programming in C++, and imposes fewer restrictions relative to C++/CLI on mixing types. The Component Extensions of C++/CX are recommended for use at the API-boundary only, not for other purposes. Regular C++ (with COM-specific discipline) can also be used to program with WinRT components, with the help of the Windows Runtime C++ Template Library (WRL), which is similar in purpose to what
Active Template Library The Active Template Library (ATL) is a set of template-based C++ classes developed by Microsoft, intended to simplify the programming of Component Object Model (COM) objects. The COM support in Microsoft Visual C++ allows developers to create a v ...
provides for COM. In 2019, Microsoft deprecated C++/CX in favor of the C++/WinRT header library. Most WinRT applications run within a sandbox and need explicit user approval to access critical OS features and underlying hardware. By default, file access is restricted to several predetermined locations, such as the directories Documents or Pictures. WinRT applications are packaged in the .appx and later the .msix
file format A file format is a standard way that information is encoded for storage in a computer file. It specifies how bits are used to encode information in a digital storage medium. File formats may be either proprietary or free. Some file format ...
; based upon Open Packaging Conventions, it uses a ZIP format with added XML files. WinRT applications are distributed mostly through an
application store An App Store (or app marketplace) is a type of digital distribution platform for computer software called applications, often in a mobile context. Apps provide a specific set of functions which, by definition, do not include the running of the c ...
named
Microsoft Store Microsoft Store (formerly known as Windows Store) is a digital distribution platform operated by Microsoft. It started as an app store for Windows 8 and Windows Server 2012 as the primary means of distributing Universal Windows Platform app ...
, where Windows apps (termed ''Windows Store apps'') can be purchased and downloaded by users. WinRT apps can only be sideloaded from outside Windows Store on Windows 8 or RT systems that are part of a
Windows domain A Windows domain is a form of a computer network in which all user accounts, computers, printers and other security principals, are registered with a central database located on one or more clusters of central computers known as domain controll ...
, or equipped with a special activation key obtained from Microsoft. These restrictions were lifted in the Windows 10 November Update, where users can freely sideload any app signed with a trusted certificate by enabling a setting. In a major departure from Win32 and similarly to .NET Framework 4.5, most APIs which are expected to take significant time to complete are implemented as
asynchronous Asynchrony is the state of not being in synchronization. Asynchrony or asynchronous may refer to: Electronics and computing * Asynchrony (computer programming), the occurrence of events independent of the main program flow, and ways to deal wit ...
. When calling a Windows Runtime asynchronous function, the task is started on another thread or process and the function returns immediately, freeing the app to perform other tasks while waiting for results. The asynchronous model requires new programming language constructs. Each language provides their own way to consume
asynchronous Asynchrony is the state of not being in synchronization. Asynchrony or asynchronous may refer to: Electronics and computing * Asynchrony (computer programming), the occurrence of events independent of the main program flow, and ways to deal wit ...
APIs. Parts of the built-in API needing asynchronous access include on-screen messages and dialogs, file access, Internet connectivity, sockets, streams, devices and services, and calendar, contacts and appointments.


Services


Metadata

The metadata describes the APIs written using the WinRT ABI. It defines a
programming model A programming model is an execution model coupled to an API or a particular pattern of code. In this style, there are actually two execution models in play: the execution model of the base programming language and the execution model of the prog ...
that makes it possible to write
object-oriented Object-oriented programming (OOP) is a programming paradigm based on the concept of "objects", which can contain data and code. The data is in the form of fields (often known as attributes or ''properties''), and the code is in the form of ...
code that can be shared across
programming language A programming language is a system of notation for writing computer programs. Most programming languages are text-based formal languages, but they may also be graphical. They are a kind of computer language. The description of a programming ...
s, and enables services like
reflection Reflection or reflexion may refer to: Science and technology * Reflection (physics), a common wave phenomenon ** Specular reflection, reflection from a smooth surface *** Mirror image, a reflection in a mirror or in water ** Signal reflection, in ...
.
Herb Sutter Herb Sutter is a prominent C++ expert. He is also a book author and was a columnist for Dr. Dobb's Journal. He joined Microsoft in 2002 as a platform evangelist for Visual C++ .NET, rising to lead software architect for C++/CLI. Sutter has serv ...
,
C++ C++ (pronounced "C plus plus") is a high-level general-purpose programming language created by Danish computer scientist Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significan ...
expert at
Microsoft Microsoft Corporation is an American multinational technology corporation producing computer software, consumer electronics, personal computers, and related services headquartered at the Microsoft Redmond campus located in Redmond, Washi ...
, explained during his session on C++ at the 2011 Build conference that the WinRT metadata is in the same format as CLI metadata. Native code (i.e., processor-specific machine code) cannot contain metadata, so it is stored in a separate metadata file that can be reflected like ordinary CLI assemblies. Since it is the same format as CLI metadata, WinRT APIs can be used from managed CLI languages as if it was just a .NET API.


Type system

WinRT has a rich
object-oriented Object-oriented programming (OOP) is a programming paradigm based on the concept of "objects", which can contain data and code. The data is in the form of fields (often known as attributes or ''properties''), and the code is in the form of ...
class Class or The Class may refer to: Common uses not otherwise categorized * Class (biology), a taxonomic rank * Class (knowledge representation), a collection of individuals or objects * Class (philosophy), an analytical concept used differently ...
-based
type system In computer programming, a type system is a logical system comprising a set of rules that assigns a property called a type to every "term" (a word, phrase, or other set of symbols). Usually the terms are various constructs of a computer progra ...
that is built on the metadata. It supports constructs with corresponding constructs in the .NET framework: classes,
methods Method ( grc, μέθοδος, methodos) literally means a pursuit of knowledge, investigation, mode of prosecuting such inquiry, or system. In recent centuries it more often means a prescribed process for completing a task. It may refer to: *Scien ...
,
properties Property is the ownership of land, resources, improvements or other tangible objects, or intellectual property. Property may also refer to: Mathematics * Property (mathematics) Philosophy and science * Property (philosophy), in philosophy an ...
, delegates, and events. One of the major additions to WinRT relative to COM is the cross-
application binary interface In computer software, an application binary interface (ABI) is an interface between two binary program modules. Often, one of these modules is a library or operating system facility, and the other is a program that is being run by a user. An ...
(ABI), .NET-style
generics Generic or generics may refer to: In business * Generic term, a common name used for a range or class of similar things not protected by trademark * Generic brand, a brand for a product that does not have an associated brand or trademark, other ...
. Only interfaces and delegates can be generic, runtime classes and methods in them can't. Generic interfaces are also known as parameterized interfaces. In C++/CX, they are declared using the keyword generic with a syntax very similar to that of keyword template. WinRT classes (ref classes) can also be genericized using C++ templates, but only template instantiations can be exported to .winmd metadata (with some
name mangling In compiler construction, name mangling (also called name decoration) is a technique used to solve various problems caused by the need to resolve unique names for programming entities in many modern programming languages. It provides a way of e ...
), unlike WinRT generics which preserve their genericity in the metadata. WinRT also provides a set of interfaces for generic
containers A container is any receptacle or enclosure for holding a product used in storage, packaging, and transportation, including shipping. Things kept inside of a container are protected on several sides by being inside of its structure. The ter ...
that parallel those in the
C++ Standard Library The C standard library or libc is the standard library for the C programming language, as specified in the ISO C standard. ISO/IEC (2018). '' ISO/IEC 9899:2018(E): Programming Languages - C §7'' Starting from the original ANSI C standard, it was ...
, and languages provide some reciprocal (back-and-forth) conversion functions. The consumption of WinRT collections in .NET languages (e.g., C# and VB) and in JavaScript is more transparent than in C++, with automated mappings into their natural equivalents occurring behind the scenes. When authoring a WinRT component in a managed language, some extra, COM-style rules must be followed, e.g. .NET framework collection types cannot be declared as return types, but only the WinRT interfaces that they implement can be used at the component boundary.


WinRT components

Classes that are compiled to target the WinRT are called ''WinRT components''. They are classes that can be written in any supported language and for any supported platform. The key is the metadata. This metadata makes it possible to interface with the component from any other WinRT language. The runtime requires WinRT components that are built with .NET Framework to use the defined interface types or .NET type interfaces, which automatically map to the first named. Inheritance is as yet not supported in managed WinRT components, except for XAML classes.


Programming interfaces

Programs and libraries targeted for the WinRT runtime can be created and consumed from several platforms and programming languages. Notably C/
C++ C++ (pronounced "C plus plus") is a high-level general-purpose programming language created by Danish computer scientist Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significan ...
(either with language extensions offering first-class support for WinRT concepts, or with a lower-level template library allowing to write code in standard C++), .NET ( C# and
Visual Basic .NET Visual Basic, originally called Visual Basic .NET (VB.NET), is a multi-paradigm, object-oriented programming language, implemented on .NET, Mono, and the .NET Framework. Microsoft launched VB.NET in 2002 as the successor to its original Visua ...
(VB.NET)) and
JavaScript JavaScript (), often abbreviated as JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. As of 2022, 98% of websites use JavaScript on the client side for webpage behavior, of ...
. This is made possible by the metadata. In WinRT terminology, a
language binding In programming and software design, binding is an application programming interface (API) that provides glue code specifically made to allow a programming language to use a foreign library or operating system service (one that is not native to th ...
is termed a ''language projection.''


C++ (C++/WinRT, Component Extensions, WRL)

Standard C++ is a ''first-class citizen'' of the WinRT platform. As of Windows 10, version 1803, the Windows SDK contains C++/WinRT. C++/WinRT is an entirely standard modern C++17 language projection for Windows Runtime (WinRT) APIs, implemented as a header-file-based library, and designed to provide first-class access to the modern Windows API. With C++/WinRT, Windows Runtime APIs can be authored and consumed using any standards-compliant C++17 compiler. WinRT is a native platform and supports any native (and standard) C++ code, so that a C++ developer can reuse existing native C/C++ libraries. With C++/WinRT, there are no language extensions. Prior to C++/WinRT being officially released in the Windows SDK, from October 2016, Microsoft offered on
GitHub GitHub, Inc. () is an Internet hosting service for software development and version control using Git. It provides the distributed version control of Git plus access control, bug tracking, software feature requests, task management, cont ...
C++/WinRT. It does not rely on C++/CX code, with the result of producing smaller binaries and faster code. There are two other legacy options for using WinRT from C++: Windows Runtime C++ Template Library (WRL), an ATL-style template library (similar to
Windows Template Library Windows Template Library (WTL) is a free software, object-oriented C++ template library for Win32 development. WTL was created by Microsoft employee Nenad Stefanovic for internal use and later released as an unsupported add-on to Visual Studio and ...
or WTL), and
C++/CX C++/CX ''(C++ component extensions)'' is a language projection for Microsoft's Windows Runtime platform. It takes the form of a language extension for C++ compilers, and it enables C++ programmers to write programs that call Windows Runtime (WinRT) ...
(C++ with Component Extensions) which resembles C++/CLI. Because of the internal consumption requirements at Microsoft, WRL is exception-free, meaning its return-value discipline is HRESULT-based just like that of COM. C++/CX on the other hand wraps-up calls to WinRT with code that does error checking and throws exceptions as appropriate. C++/CX has several extensions that enable integration with the platform and its type system. The syntax resembles the one of
C++/CLI C++/CLI is a variant of the C++ programming language, modified for Common Language Infrastructure. It has been part of Visual Studio 2005 and later, and provides interoperability with other .NET languages such as C#. Microsoft created C++/CLI ...
although it produces native (although not standard) code and metadata that integrates with the runtime. For example, WinRT objects may be allocated with ref new, which is the counterpart of gcnew from C++/CLI. The hat operator ^ retains its meaning, however in the case where both the caller and callee are written in C++ and living in the same process, a hat reference is simply a pointer to a vptr to a
virtual method table In computer programming, a virtual method table (VMT), virtual function table, virtual call table, dispatch table, vtable, or vftable is a mechanism used in a programming language to support dynamic dispatch (or run-time method binding). Whe ...
(vtable, VMT).Under the covers with C++ for Metro style apps
with Deon Brewis at //Build
Along with C++/CX, relative to traditional C++ COM programming, are partial classes, again inspired by .NET. These allow instance
WinRT XAML Windows UI Library (WinUI codenamed "Jupiter", and also known as UWP XAML and WinRT XAML) is a user interface API that is part of the Windows Runtime programming model that forms the backbone of Universal Windows Platform apps (formerly known as ...
code to be translated into C++ code by tools, and then combined with human-written code to produce the complete class while allowing clean separation of the machine-generated and human-edited parts of a class implementation into different files.


.NET

The
.NET Framework The .NET Framework (pronounced as "''dot net"'') is a proprietary software framework developed by Microsoft that runs primarily on Microsoft Windows. It was the predominant implementation of the Common Language Infrastructure (CLI) until bein ...
and the
Common Language Runtime The Common Language Runtime (CLR), the virtual machine component of Microsoft .NET Framework, manages the execution of .NET programs. Just-in-time compilation converts the managed code (compiled intermediate language code) into machine instru ...
(CLR) are integrated into the WinRT as a subplatform. It has influenced and set the standards for the ecosystem through the metadata format and libraries. The CLR provides services like JIT-compilation code and
garbage collection Waste collection is a part of the process of waste management. It is the transfer of solid waste from the point of use and disposal to the point of treatment or landfill. Waste collection also includes the curbside collection of recyclabl ...
. WinRT applications using .NET languages use the XAML-based WinUI, and are primarily written in C#, VB.NET, and for the first time for XAML, with
native code In computer programming, machine code is any low-level programming language, consisting of machine language instructions, which are used to control a computer's central processing unit (CPU). Each instruction causes the CPU to perform a ver ...
using C++/CX. Although not yet officially supported, programs can also be written in other .NET languages. With .NET 5, Microsoft removed the built-in WinRT support and instead created CsWinRT, a tool that generates interop code for accessing Windows Runtime APIs similar to how C++/WinRT works.


= Limitations

= Classes defined in WinRT components that are built in managed .NET languages must be declared as sealed, so they cannot be derived from. However, non-sealed WinRT classes defined elsewhere can be inherited from in .NET, their virtual methods overridden, and so on; but the inherited managed class must still be sealed. Members that interface with another language must have a signature with WinRT types or a managed type that is convertible to these.


JavaScript

WinRT applications can also be coded using
HTML The HyperText Markup Language or HTML is the standard markup language for documents designed to be displayed in a web browser. It can be assisted by technologies such as Cascading Style Sheets (CSS) and scripting languages such as JavaS ...
with
JavaScript JavaScript (), often abbreviated as JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. As of 2022, 98% of websites use JavaScript on the client side for webpage behavior, of ...
in code-behind, which are run using the
Trident A trident is a three- pronged spear. It is used for spear fishing and historically as a polearm. The trident is the weapon of Poseidon, or Neptune, the God of the Sea in classical mythology. The trident may occasionally be held by other mar ...
rendering engine Rendering or image synthesis is the process of generating a photorealistic or non-photorealistic image from a 2D or 3D model by means of a computer program. The resulting image is referred to as the render. Multiple models can be defined ...
and
Chakra Chakras (, ; sa , text=चक्र , translit=cakra , translit-std=IAST , lit=wheel, circle; pi, cakka) are various focal points used in a variety of ancient meditation practices, collectively denominated as Tantra, or the esoteric or ...
JavaScript engine, both of which are also used by
Internet Explorer Internet Explorer (formerly Microsoft Internet Explorer and Windows Internet Explorer, commonly abbreviated IE or MSIE) is a series of graphical web browsers developed by Microsoft which was used in the Windows line of operating systems (in ...
. When coding a WinRT app in JavaScript, its features are adapted to follow JavaScript naming conventions, and namespaces are also mapped to JavaScript objects.


Other languages

Microsoft is in the process of projecting WinRT APIs to languages other than C++. One example is Rust/WinRT, an interface for programs written in
Rust Rust is an iron oxide, a usually reddish-brown oxide formed by the reaction of iron and oxygen in the catalytic presence of water or air moisture. Rust consists of hydrous iron(III) oxides (Fe2O3·nH2O) and iron(III) oxide-hydroxide (FeO( ...
to consume and author WinRT APIs. Rust/WinRT is part of
Windows App SDK Windows App SDK (formerly known as Project Reunion) is a software development kit (SDK) from Microsoft that targets the development of native desktop applications on Windows 11 and Windows 10 back to version 1809. Windows App SDK does not replac ...
(formerly Project Reunion), a Microsoft effort to reconcile traditional Windows desktop and the UWP app model.


Bridges

With the introduction of the
Universal Windows Platform Universal Windows Platform (UWP) is a computing platform created by Microsoft and first introduced in Windows 10. The purpose of this platform is to help develop universal apps that run on Windows 10, Windows 10 Mobile (discontinued), Windo ...
(UWP), the platform has received many API bridges that allow programs originally developed for other platforms to be ported easily while taking advantage of UWP features. Microsoft has provided bridges for Android (defunct since 2016), iOS (
Cocoa Touch Cocoa Touch is the application development environment for building software programs to run on iOS for the iPhone and iPod Touch, iPadOS for the iPad, watchOS for the Apple Watch, and tvOS for the Apple TV, from Apple Inc. Cocoa Touch ...
), Progressive Web Apps,
Silverlight Microsoft Silverlight is a discontinued application framework designed for writing and running rich web applications, similar to Adobe's runtime, Adobe Flash. A plugin for Silverlight is still available for a very small number of browsers. Whi ...
, as well as traditional Windows desktop apps (using MSIX packaging from the
Windows App SDK Windows App SDK (formerly known as Project Reunion) is a software development kit (SDK) from Microsoft that targets the development of native desktop applications on Windows 11 and Windows 10 back to version 1809. Windows App SDK does not replac ...
).


API

WinRT comes with an
application programming interface An application programming interface (API) is a way for two or more computer programs to communicate with each other. It is a type of software interface, offering a service to other pieces of software. A document or standard that describes how ...
(API) in the form of a class library that exposes the features of Windows 8 for the developer, like its immersive interface API. It is accessible and consumable from any supported language.


Runtime classes

The Windows Runtime classes is a set SDKs that provide access to all functionality from the
XAML Extensible Application Markup Language (XAML ) is a declarative XML-based language that Microsoft developed for initializing structured values and objects. It is available under Microsoft's Open Specification Promise. XAML is used extensively ...
parser to the camera function. The SDKs are implemented as native C/C++ libraries (unmanaged).


Naming conventions

The naming conventions for the components (classes and other members) in the API are heavily influenced by the .NET naming conventions which uses
camel case Camel case (sometimes stylized as camelCase or CamelCase, also known as camel caps or more formally as medial capitals) is the practice of writing phrases without spaces or punctuation. The format indicates the separation of words with a single ...
(specifically PascalCase). Microsoft recommends users to follow these rules in case where no others are given. These conventions are projected differently in some languages, like JavaScript, which converts it to its conventions and the other way around. This is to give a native and consistent experience regardless of the programming language.


Restrictions and rules

Since Windows Runtime is projected to various languages, some restrictions on fundamental data types exist so as to host all such languages. Programmers must be careful with the behavior of those types when used with public access (for method parameters, method return values, properties, etc.). ;Basic types : In .NET languages and C++, a rich set of data types exists, representing various numerals. : In JavaScript, a Number can only represent up to 53 bits of precision. : In WinRT, the only lacking numeral data type is 8-bit signed integer relative to .NET and C++. JavaScript developers must be careful when dealing with big numbers while coding for WinRT. ;Strings : Strings are immutable in .NET and JavaScript, but mutable in C++. : A null pointer passed as a string to WinRT by C++ is converted to an empty string : In .Net, null being passed as a string to WinRT is converted to an empty string : In JavaScript, null being passed as a string to WinRT is converted to a string with the word null. This is due to JavaScript's keyword null being represented as a null object. Similar results occur when passing undefined to WinRT from JavaScript. ;Structs : In .NET and C++, structs are value types, and such a struct can contain any type in it. : JavaScript does not directly support structs. : In WinRT, use of structs is allowed only for containing types that have value semantics, including numerals, strings, and other structs. Pointers or interface references are disallowed. ;References : In .NET, objects are passed by reference, whereas numerals and structs are passed by value. : In C++, all types can be passed by reference or value. : In WinRT, interfaces are passed by reference; all other types are passed by value. ;Arrays : In .NET, C++, and JavaScript arrays are reference types. : In WinRT, arrays are value types. ;Events : In .NET and C++, clients subscribe to events using += operator. : In JavaScript, addEventListener function or setting on property is used to subscribe to events. : In WinRT, all languages can use their own way to subscribe to events. ;Collections : Some .NET collections map directly to WinRT collections. : WinRT ''Vector'' type resembles arrays and the array syntax is used to consume them. : WinRT ''Map'' type is a key/value pair collection, and is projected as Dictionary in .NET languages. ;Method overloading : All WinRT languages (.NET, C++, JavaScript) support overloading on parameters : .NET and C++ also support overloading on type. : In WinRT, only parameter number is used for overloading. ;Asynchrony : All WinRT methods are designed such that any method taking longer than 50 milliseconds is an async method. : The established naming pattern to distinguish asynchronous methods is Noun>sync. For the full runtime library, all methods that have a chance to last longer than 50 ms are implemented as asynchronous methods only.


Windows Phone Runtime

Windows Phone 8.1 Windows Phone 8.1 is the discontinued third generation of Microsoft's Windows Phone mobile operating system, succeeding Windows Phone 8. Rolled out at Microsoft's Build Conference in San Francisco, California, on April 2, 2014, it was released ...
uses a version of the Windows Runtime named the ''Windows Phone Runtime''. It enables developing applications in C# and VB.NET, and Windows Runtime components in C++/CX. Although WP8 brought limited support, the platform did eventually converge with
Windows 8.1 Windows 8.1 is a release of the Windows NT operating system developed by Microsoft. It was released to manufacturing on August 27, 2013, and broadly released for retail sale on October 17, 2013, about a year after the retail release of its pre ...
in
Windows Phone 8.1 Windows Phone 8.1 is the discontinued third generation of Microsoft's Windows Phone mobile operating system, succeeding Windows Phone 8. Rolled out at Microsoft's Build Conference in San Francisco, California, on April 2, 2014, it was released ...
.


Windows Phone 8

Windows Phone 8 has limited support for developing and consuming Windows Runtime components through ''Windows Phone Runtime''. Many of the Windows Runtime APIs in Windows 8 that handle core operating system functions have been ported to Windows Phone 8. Support for developing native games using C++/CX and DirectX has been added, by request from the game development industry. However, the Windows Phone XAML Framework is still based on the same
Microsoft Silverlight Microsoft Silverlight is a discontinued application framework designed for writing and running rich web applications, similar to Adobe's runtime, Adobe Flash. A plugin for Silverlight is still available for a very small number of browsers. ...
framework, as in Windows Phone 7, for backward compatibility. Thus, , XAML development is impossible in C++/CX. Development using either HTML5 or WinJS is unsupported on Windows Phone 8.


Windows Phone 8.1

Windows Runtime support on Windows Phone 8.1 converges with Windows 8.1. The release brings a full Windows Runtime API to the platform, including support for
WinRT XAML Windows UI Library (WinUI codenamed "Jupiter", and also known as UWP XAML and WinRT XAML) is a user interface API that is part of the Windows Runtime programming model that forms the backbone of Universal Windows Platform apps (formerly known as ...
, and language bindings for
C++/CX C++/CX ''(C++ component extensions)'' is a language projection for Microsoft's Windows Runtime platform. It takes the form of a language extension for C++ compilers, and it enables C++ programmers to write programs that call Windows Runtime (WinRT) ...
, and
HTML5 HTML5 is a markup language used for structuring and presenting content on the World Wide Web. It is the fifth and final major HTML version that is a World Wide Web Consortium (W3C) recommendation. The current specification is known as the HTML ...
-
JavaScript JavaScript (), often abbreviated as JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. As of 2022, 98% of websites use JavaScript on the client side for webpage behavior, of ...
. There is also a project type called ''Universal apps'' to enable apps to share code across 8.1 versions of Windows Phone and Windows. The Windows Phone 8 Silverlight Framework has been updated. It can exploit some of the new features in the Windows Runtime. Windows Phone Runtime uses the
AppX Universal Windows Platform (UWP) apps (formerly Windows Store apps and Metro-style apps) are applications that can be used across all compatible Microsoft Windows devices, including personal computers (PCs), tablets, smartphones, Xbox One, Mic ...
package format from Windows 8, after formerly using Silverlight XAP.


References


External links

* {{Microsoft Windows components .NET Framework implementations Computer-related introductions in 2012 Windows APIs Windows technology Application programming interfaces