search
HomeTechnology peripheralsAIReplace C++! 36,000 lines of Rust code rewrite the Windows kernel. This language was first used to repair elevators

Replacing C, Rust is really going to rewrite everything!

After gaining the favor of Linux, Google, Amazon Cloud and other major manufacturers, the latest explosive news-

Microsoft has rewritten the Windows kernel with 36,000 lines of Rust code .

And the progress is quite fast. Spoiler news for April, after two weeks, the internal preview version of Windows 11 has been used.

Microsoft Cloud Azure CTO excitedly shouted on Twitter:

If you join the Windows 11 Insider Preview internal test, you will experience the Windows kernel supported by Rust for the first time!

Replace C++! 36,000 lines of Rust code rewrite the Windows kernel. This language was first used to repair elevators

The rewritten kernel mainly includes two projects: DWriteCore and Win32 GDI, and has passed all Windows boot tests.

Among them, Win32 GDI was written in the late 1980s and early 1990s, and is an old code with more than 30 years of working experience.

The reason why it is now replaced by Rust is simple and crude:

The Rust language has extremely high memory security, and there are a large number of unsafe subroutines in the original kernel. It also disappeared after being rewritten. At the same time, the Rust language is more concise and efficient.

Public information also indicates that over time, the Windows kernel's adoption of Rust will be significantly expanded.

Not only is it favored by major manufacturers, Rust has also been the “most popular programming language” in the Stack Overflow developer survey for many years in a row. Recently, sudo and su, the basic tools of Unix systems, have also been rewritten in Rust.

But what’s a bit surprising is that when Rust was first invented, was actually for repairing elevators? ? ?

Decided to develop a new language after climbing 21 floors in anger

The origin of everything lies in one day in 2006, a man named Graydon Hoare(Graydon Hoare) The elevator in the apartment building where I lived was broken again.

For the nth time, he struggled to crawl to his home on the 21st floor while cursing. He couldn't figure out why the elevator system collapsed so easily? It shouldn’t be!

As a coder in a large factory, Brother Graydon feels that this matter is not impossible to solve.

He was 29 years old at the time and working part-time at the open source web browser Mozilla Company (the company behind Firefox) . As an industry insider, he knows that most elevator failures are caused by the programming language that easily introduces memory errors accidentally, causing software crashes.

At that time, elevator software was often written in C or C language.

Their advantages are compactness and speed, but the problem is that it is very easy to cause memory errors, lead to system crashes, and even security issues.

So he kept doing nothing. In order to stop climbing stairs, Brother Graydon simply decided to come up with a new programming language.

The goal is a language that is less prone to memory errors, preferably shorter and faster.

So, the Rust language was born.

And the name of Rust is also very interesting.

Rust has the same name as a fungus, the Chinese name of which is plant rust. Graydon commented that it is "over-designed for survival."

This kind of fungal biological structure is completely distributed, with no single point of failure in space. That is to say, removing any part alone will not affect its survival, and it is extremely robust.

Throughout the life cycle, Rust fungi have a total of 5 life forms, 3 of which can regress back to the previous form, which is almost equivalent to the fact that a butterfly can turn back into a caterpillar and grow again.

Moreover, Rust fungi can be parasitic on multiple hosts, which reflects the Rust language's emphasis on interoperability between languages.

Replace C++! 36,000 lines of Rust code rewrite the Windows kernel. This language was first used to repair elevators

△A plant with Rust (Sorry for those who are cryptophobic!)

After several years of solo development, Rust was acquired by Mozilla in 2009 Supported by the company's research institute; the project was announced in 2010.

During the development process, Rust has established a highly active community. Any developer can directly report bugs to this project or directly contribute source code.

In May 2015, Rust version 1.0 was officially released.

In just one year, Rust has attracted countless fans. Since 2016, it has been rated "the most popular programming language" by the Stack Overflow developer survey for 7 consecutive years.

The advantages that it relies on to continuously top the list are: first, fast running speed, second, high memory utilization, and third, prevention of segfaults.

In short, it is a powerful tool that can replace C/C in some parts.

So there is a saying in the code world that compares Rust to parkour. You can do high-risk moves, but it is not easy to hurt yourself.

In contrast, C can be seen as playing with a flaming chainsaw.

And by virtue of developing Rust, Brother Graydon also became famous in one battle.

In the following years, he also participated in the development of Swift.

This is also an interesting story. Compared to being a team leader, I seem to prefer doing front-line development.

He once said in response to "Why left the Rust team" that his personal emotional life suffered a heavy blow (divorce) around 2013, which resulted in him not having much energy to be responsible for the Rust team. Later, he was still the president of Mozilla. I worked on some projects that were low-key and not in a hurry to be launched, and then I left my job.

Until early 2016, he received a call from the Apple team, saying that they were looking for programmers to help develop Swift. "It was a non-leadership position that I preferred."

Relying on safety to become the darling of major manufacturers

But here, Rust’s legendary story is only half told.

With the original intention of "high safety", it has become increasingly popular among large manufacturers in recent years.

Not only Windows, but also mainstream systems such as Linux and Android have embraced Rust. The relationship between Amazon Cloud, Microsoft, Google and Rust has always been good.

The main reason for this may be that C/C is really not good at memory safety.

For exampleMicrosoft was very interested in Rust a few years ago. They identified it as a way to eliminate memory security vulnerabilities before product delivery. good idea.

In 2019, Microsoft admitted that 70% of the vulnerabilities disclosed by CVE in its products were memory security vulnerabilities caused by the use of C/C.

The Rust tool chain focuses on uncovering potential vulnerabilities in the code, which ideally reduces the possibility of the code being attacked.

On the other side, Rust has also been introduced into the Linux kernel.

Last year, at the 2022 Open Source Summit hosted by the Linux Foundation, Mr. Linus suddenly announced that Rust might be added to the next version!

This means that the official PR for Rust for Linux will be merged into the mainline of the Linux kernel.

(Rust for Linux is an organization that calls for the combination of Linux and Rust)

You must know that the Rust support patch alone has been released to the seventh version .

When the audience heard the news, they immediately burst into applause, so that it took Linus a while to calm everyone down.

A few months later, Linux version 6.1 was released, and the kernel added support for Rust, becoming the second official language besides C.

Google’s actions were actually earlier.

When Android 12 is released in 2021, it will be announced that it supports Rust. Since then, they have been expanding the use of Rust in the Android open source project.

However, Google’s approach is not to immediately replace C/C with Rust, but to write new code in Rust.

It can be seen from the official data that C and C still dominate, and the proportion of Rust is gradually increasing.

Replace C++! 36,000 lines of Rust code rewrite the Windows kernel. This language was first used to repair elevators

As of the end of last year, Google stated that no security vulnerabilities had been found in the parts of Android written in Rust.

This result is very important because it means that Rust can effectively prevent the most common vulnerability in Android-that is, memory safety vulnerability. Google's 22-year data shows that memory security vulnerabilities account for a very high proportion of all types of vulnerabilities.

Replace C++! 36,000 lines of Rust code rewrite the Windows kernel. This language was first used to repair elevators

In many components written in C/C (such as Bluetooth, NFC, etc.), there will be a vulnerability in every thousand lines of code . Based on this ratio,

Rust has probably blocked hundreds of vulnerabilities.

And based on its high concurrency advantages, using Rust in Android can further balance system security and latency. Generally speaking, some security measures will cause the programming language to slow down.

For example, using the new UWB stack, you can save several megabytes of memory and avoid some IPC delays by running through existing processes.

Amazon Cloud also likes Rust very much,

because it is also very nice in saving energy.

A study tested 27 programming languages ​​and found that C and Rust were 50% more efficient than Java and 98% more efficient than Python in terms of energy use.

But the problem of C has been mentioned many times, and there are many memory security vulnerabilities, so based on this, Rust wins again.

Replace C++! 36,000 lines of Rust code rewrite the Windows kernel. This language was first used to repair elevators

In fact, major manufacturers not only favor Rust, but even dote on it.

In 2020, Mozilla, the company behind Rust, announced large-scale layoffs, the Rust team was laid off, and the fate of Rust fell into huge uncertainty.

In order to avoid this hidden worry, major manufacturers such as Amazon, Microsoft, Google, and Huawei directly jointly launched a Rust non-profit foundation. Commitment to invest approximately US$1 million in budget within two years to support Rust project maintenance.

In the industry, Rust’s deeds are countless.

Recently, two core Unix-like utilities sudo and su are being rewritten in Rust; previously, GitHub changed its search engine to be based on Rust; Discord, a Go service, was also rewritten in Rust...

However, Rust also has shortcomings. For example, it is more difficult to learn later, and the development speed is much slower than Go and Java when you first get started.

So Rust has high praise, but its "sales rate" is still relatively average, and it may even be labeled as an "unpopular language".

Especially in China, the recruitment of Rust can be described as "pitifully few".

Some netizens are pessimistic:

Replace C++! 36,000 lines of Rust code rewrite the Windows kernel. This language was first used to repair elevators

For this reason, Rust is also further optimizing itself.

According to the Rust 2024 roadmap released by it, the official team will increase its efforts in lowering the learning threshold and strengthening ecological connections.

So, it’s still worth looking forward to how Rust will develop in the future~

The above is the detailed content of Replace C++! 36,000 lines of Rust code rewrite the Windows kernel. This language was first used to repair elevators. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:51CTO.COM. If there is any infringement, please contact admin@php.cn delete
Most Used 10 Power BI Charts - Analytics VidhyaMost Used 10 Power BI Charts - Analytics VidhyaApr 16, 2025 pm 12:05 PM

Harnessing the Power of Data Visualization with Microsoft Power BI Charts In today's data-driven world, effectively communicating complex information to non-technical audiences is crucial. Data visualization bridges this gap, transforming raw data i

Expert Systems in AIExpert Systems in AIApr 16, 2025 pm 12:00 PM

Expert Systems: A Deep Dive into AI's Decision-Making Power Imagine having access to expert advice on anything, from medical diagnoses to financial planning. That's the power of expert systems in artificial intelligence. These systems mimic the pro

Three Of The Best Vibe Coders Break Down This AI Revolution In CodeThree Of The Best Vibe Coders Break Down This AI Revolution In CodeApr 16, 2025 am 11:58 AM

First of all, it’s apparent that this is happening quickly. Various companies are talking about the proportions of their code that are currently written by AI, and these are increasing at a rapid clip. There’s a lot of job displacement already around

Runway AI's Gen-4: How Can AI Montage Go Beyond AbsurdityRunway AI's Gen-4: How Can AI Montage Go Beyond AbsurdityApr 16, 2025 am 11:45 AM

The film industry, alongside all creative sectors, from digital marketing to social media, stands at a technological crossroad. As artificial intelligence begins to reshape every aspect of visual storytelling and change the landscape of entertainment

How to Enroll for 5 Days ISRO AI Free Courses? - Analytics VidhyaHow to Enroll for 5 Days ISRO AI Free Courses? - Analytics VidhyaApr 16, 2025 am 11:43 AM

ISRO's Free AI/ML Online Course: A Gateway to Geospatial Technology Innovation The Indian Space Research Organisation (ISRO), through its Indian Institute of Remote Sensing (IIRS), is offering a fantastic opportunity for students and professionals to

Local Search Algorithms in AILocal Search Algorithms in AIApr 16, 2025 am 11:40 AM

Local Search Algorithms: A Comprehensive Guide Planning a large-scale event requires efficient workload distribution. When traditional approaches fail, local search algorithms offer a powerful solution. This article explores hill climbing and simul

OpenAI Shifts Focus With GPT-4.1, Prioritizes Coding And Cost EfficiencyOpenAI Shifts Focus With GPT-4.1, Prioritizes Coding And Cost EfficiencyApr 16, 2025 am 11:37 AM

The release includes three distinct models, GPT-4.1, GPT-4.1 mini and GPT-4.1 nano, signaling a move toward task-specific optimizations within the large language model landscape. These models are not immediately replacing user-facing interfaces like

The Prompt: ChatGPT Generates Fake PassportsThe Prompt: ChatGPT Generates Fake PassportsApr 16, 2025 am 11:35 AM

Chip giant Nvidia said on Monday it will start manufacturing AI supercomputers— machines that can process copious amounts of data and run complex algorithms— entirely within the U.S. for the first time. The announcement comes after President Trump si

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.