Microsoft has announced that it has rewritten the core Windows libraries in the Rust programming language, with more memory-safe code already available to developers.
The introduction of Rust into the Windows kernel was announced by David Weston, head of OS security for Windows, at BlueHat IL 2023 last month. Microsoft has been interested in Rust for several years, as it provides a way to find and fix memory safety bugs before they reach users. Rust aims to prevent exploitable code from being built and shipped, reducing the opportunities for attackers to exploit software weaknesses.
With growing industry interest in memory-safe programming, Microsoft’s commitment to Rust is becoming more enthusiastic. The Rust refactoring for Windows started in 2020 with DWriteCore, an implementation of the Windows App SDK that contains the Windows DWrite engine. Glyph performance with shaping (permutation) and OpenType Library Services (OTLS) is now 5-15% faster, in addition to improving memory safety. The Microsoft Windows Graphics Device Interface (Win32 GDI) has also been ported to Rust and now contains 36,000 lines of Rust code.
Microsoft’s move to Rust is a significant step forward in memory-safe programming. The introduction of Rust into the Windows kernel has already made more memory-safe code available to developers.
While Microsoft’s endorsement of Rust has its limits, code contributions make Rust more capable and benefit the open-source community as a whole. With growing industry interest in memory-safe programming, it will be interesting to see how Rust continues to evolve in the coming years.