Microsoft has announced the latest version of its Rust for Windows project, version 0.9.
Rust for Windows is a language projection for Windows, and lets developers use any Windows API via the windows crate (Rust’s term for a binary or a library). The Rust for Windows ‘windows crate’ version 0.9 is now available on the Rust Foundation’s crates.io website.
The aim of Rust for Windows – formerly Rust/WinRT – is to ease the path for developers looking to write Windows applications in Rust by allowing them to naturally call a variety of Windows application programming interfaces (APIs), including Win32, COM (Component Object Model), and WinRT.
SEE: Hiring Kit: Python developer (TechRepublic Premium)
Rust for Windows is still in preview and was released last May to help developers bring Rust into the picture for building desktop apps, store apps and device drivers.
Microsoft, Amazon Web Services, Google and Facebook are looking to Rust to build on older C++ code due to Rust’s memory safety features, which helps minimize memory safety security flaws – the largest category of security vulnerabilities that get patched each month by Microsoft.
While Rust is not strictly limited to systems programming, that’s what it’s become popular for among larger tech companies. Google is writing new components of Android in Rust, while AWS uses it widely for infrastructure programming.
Rust for Windows takes its cue from Microsoft’s older C++/WinRT and aims to provide a “natural and idiomatic way for Rust developers to call Windows APIs.”
“With completed consumption support, you can now call any Windows APIs (past, present, and future) using the Rust language projection,” said Angela Zhang, a program manager at Microsoft.
“Rust developers have access to the entire Windows API surface in a language-idiomatic way, allowing them to easily take advantage of the power and breadth of Windows development.”
Zhang provided a few key improvements and changes to Windows for Rust since releasing the preview as Rust/WinRT, including that windows crate has unified Win32 and COM APIs.
“With this increased coverage and unification of Windows APIs, we changed the name of the project from ‘Rust/WinRT’ to ‘Rust for Windows’,” Zhang notes.
There are also new app examples on the Rust for Windows repository that demo how to call Win32, COM, and WinRT APIs.
SEE: Programming languages: JavaScript has most developers but Rust is the fastest growing
Also, the windows crate is now published on crates.io and it’s dual licensed under MIT or Apache licenses.
The windows chat now builds on Linux while there are improvements for Win32 APIs, such as support for array types, a variety of string types, and updated metadata. Microsoft also promises improved build times and error handling.
To get developers started with the crate’s new support for Win32 APIs, Microsoft has provided instructions for creating a simple app in Rust.