Microsoft is rewriting core Windows code in Rust
Core Windows components are rewritten in the memory-safe programming language Rust by Microsoft engineers, according to David Weston, Enterprise and OS Security Vice President at Microsoft.
Weston revealed the change during the BlueHat IL 2023 conference. Microsoft engineers replace C++ code with Rust. Windows could soon boot "with Rust in the kernel" stated Weston, who suggested that this could happen in the next couple of weeks or months already.
Microsoft has shown interest in the Rust programming language, especially because of the languages security features that are designed to prevent code that could potentially be exploited.
Broken down to its core, Rust is an easier to learn language that benefits from strong features that prevent common forms of attacks against the programs and services that have been created in the programming language.
Microsoft's main goal at this point was to "convert some [..] internal C++ data types into their Rust equivalents" according to Weston. About 36,000 lines of Rust code are now part of the Microsoft Windows graphics device interface, Win32 GDI. A recent Windows 11 version with the Rust components included booted without major issues and passed all GDI tests.
Microsoft ran benchmarks and performance tests to test the code against the non-Rust version, and no major performance regressions were detected during these tests.
The Rust part is not enabled by default for customers who use the operating system. Microsoft may use a controlled roll out in the coming weeks or months to test the functionality on a wider set of devices. Eventually, the company will enable the Rust parts for all customers who run Windows 11.
It is too early to tell how beneficial the integration will be in the short run. The converted parts will likely be more secure against potential exploits and if this initial launch is promising , will likely result in more code being converted from C++ to Rust.
For Rust, it is a major push in the right direction. Microsoft's commitment to Rust could improve general and developer tooling support.
Actually, Microsoft along with Amazon, Google and Huawei is one of the founding members of the Rust programming language according to their site: https://foundation.rust-lang.org/members/
So does this mean the whole Windows OS will ultimately be rewritten using Rust I wonder. Well, not completely since that would mean all Windows licenses would have to become available for free since Rust is open source software and Microsoft has never been an advocate of free software AFAIK.
Still, it’ll be interesting to see how it develops.
I don’t think that using an open-source language forces you to license your software as open-source. Just like writing some software on a linux machine doesn’t mean that the software has to be open-source.
And anyways, https://www.rust-lang.org/policies/licenses says that it’s dual licensed, with one license being MIT, which allows sublicensing.
I knew the Windows code was old, but it gives a different meaning to “code rust”.
A pretty joke, a must say!
https://en.wikipedia.org/wiki/Windows_NT
Windows NT 10 – July 29, 2015
Is NT 10 ‘the last version’ everyone quotes Windows 10 to be? Windows version may change even if fully re-written in RUST but it remains NT10? That’s a bit like a vintage car with all pats except the number plate replaced {my favorite axe is over 100 years old. It only has two new heads and 10 new handles}.
To the point, Windows 10/11 may be familiar to look at but if components keep changing, is it old code?
@Anonymous, W11 should be NT 11. I don’t remember now the exact site I visited some time ago searching for one update of one driver for my first computer, however the site said that I was using W10 not W11, and the site offered the drivers for W10. I needed to refine the search by OS and then I finally found the exact driver for the W11. However, at first instance, the site offered the W10 version. Anyway I turn back to W10 so I don’t have this problem now.
Microsoft engineers = ChatGPT.
..Rust In Peace.
They have too much to rewrite. They are unable to rebuild a better W11 and they want to rewrite entire Windows. Drugs tests are needed before enter to their offices. Probably.
Microsoft is rewriting core Windows code in Rust, but they’d “have too much to rewrite”? Maybe not with the help of ChatGPT? (LOL). Just makes me wonder if AI would ever be able to write the entire code of a browser, something like ‘ChatGPT Browser’, which would maybe yell at the user trying to tweak it “Hey, don’t touch me, I’m perfect, nothing to change!”.
@Tom, LOL, indeed I meant that they have too much to rewrite in the most ironic words that I have been able to use, with no ofending terms. I think that Microsoft have too many things that can be rewritten, to be redone, to be painted, to be washed… As you see, I am more cautious, otherwise the comment would fly at high speed (LOL). :]
Prevent potentially exploitable code lol, but they created a huge security hole with all the webview2 nonsense inside the Windows shell.
Windows is like Humpty Dumpty. They will never be able to fix it without starting over from scratch.
Why reduced performance?!! :(