Microsoft announces Rust/WinRT, open source Rust for the Windows Runtime
Microsoft has launched Rust/WinRT, a Windows runtime project based on Rust. This project is in the same vein as C++/WinRT. It uses standard languages and compilers to build language projections for the Windows Runtime, which makes it easy for Rust developers to call Windows APIs and more easily use Rust to build various Windows applications and components.
The Windows Runtime is based on the internal Component Object Model (COM) API and needs to be accessed through language projections such as C++/WinRT and Rust/WinRT. Those language projections take the metadata describing various APIs and provide natural bindings for the target programming language. As you can imagine, this allows developers to more easily build apps and components for Windows using their desired language. You can then use those Windows APIs to build desktop apps, store apps, or something more unique like a component, NT service, or device driver.
Rust/WinRT was proposed by Kenny Kerr, an engineer from the Windows team, in November last year, and began to experiment. He said in a blog post at that time that the Windows runtime has begun to add support for various languages, but these cannot be separated from C ++ until the emergence of Rust.
According to Microsoft’s introduction, Rust/WinRT can directly call the WinRT API into the Rust package at any time period, and developers can call them like the Rust module.
Currently, Rust/WinRT is still in an early preview state. Microsoft hopes that it will provide more seamless interoperability with existing Win32 and COM APIs, including support for the com-rs crate. The source code is available on Github.