Programming languages: Time to stop using C and C++ for new projects, says Microsoft Azure CTO

Photo: Degres/Getty

Mark Rossinovich, head of technology office (CTO) at Microsoft Azure, says developers should avoid using C or C++ programming languages ​​in new projects and use Rust instead due to security and reliability concerns.

rust that Version 1.0 hit in 2020 Born in Mozilla, it is now used in the Android Open Source Project (AOSP), in deadin Amazon Web Services, at Microsoft for parts of Windows and Azure, in the Linux kernel, and in many other places.

Engineers value its “memory security guarantees”, which reduce the need to manually manage program memory, and thus reduce the risk of memory-related security flaws that burden large projects written in “unsafe memory” C or C++, which includes Chrome, Android Linux kernel and Windows.

also: The most popular programming languages ​​and places to learn them

Microsoft pushed this home Point in 2019 after revealing 70% of its spots in the past 12 years They were memory security bug fixes largely due to Windows being written mostly in C and C++. Google Chrome Team Weighing It With Its Own Results in 2020, which revealed that 70% of all serious security bugs in Chrome’s software database were related to memory management and security bugs. It was written mostly in C++.

“Unless something strange happens, it [Rust] It will reach 6.1,” Torvalds wrote, seemingly ending a long-running debate about Rost becoming a second language for C for the Linux kernel.

The only qualification to the Azure CTO about using Rust is that it was preferred over C and C+ for new projects that require a non-garbage aggregator (GC) language. GC engines deal with memory management. Google’s Go is the language of garbage collection, while Project Rust Promotes that rust is not. AWS engineers Like Rust over Go because of the efficiencies it provides without GC.

“Speaking of languages, it is time to stop starting any new projects in C/C++ and using Rust for those scenarios that require a language other than GC. For the sake of security and reliability. The industry should declare these languages ​​deprecated,” Rossinovich wrote.

Rust is a promising alternative to C and C++, especially for systems-level programming, infrastructure projects, embedded software development, and more – but not everywhere and not in all projects.

In fact, Rusinovic added later: “There is a massive amount of C/C++ that will be maintained and developed for decades (or longer). Last night I coded a feature for Handle, adding to the roughly 85,000 lines of Sysinternals C/C++ code that I wrote. Having said that. I’ll align myself with Rust for the new tools.”

Rust is seriously moving forward and it probably will be in the Linux kernel thus.

AOSP, which is a Linux distribution, I started using Rust on a new code in April 2021 but left the C/C++ code base in place. That month, AOSP also Supported calls to Rust as a new code option in the Linux kernel.

also: How to Easily Run Websites as Apps in Linux

Meta recently promoted Rust as Server-side supported base language Along with C++. AWS is investing in Rust for infrastructure programs. Azure engineers are used to it Create cloud tools for testing WebAssembly modules in Kubernetes. On the other hand, the Chrome team is associated with C++ for the foreseeable future, although attention to rust; Simply switch to rust It won’t eliminate a large percentage of security vulnerabilities for yearsThey said. Instead, Chrome brings memory security to its C++ codebase.

Also, Rust shouldn’t be considered a silver bullet for all the bad habits developers have when coding in C or C++.

Bob Rhodes, a cybersecurity researcher at GreyNoise Intelligence, formerly with Rapid7, pointed Developers can afford the same bad security habits to Rust.

Given what it takes (time/money/people/services) to make C/C++ projects ‘real’ safe at any speed, I tend to agree [with Russinovich]. Having said that, it is possible to bring the same bad practices to Rost.”

Stephen J. Vaughan Nichols from ZDNet It is widely agreed upon With this feeling:

As others have said, you can ‘safely’ write in C or C++, but it’s much more difficult, no matter what dialect you’re using than in Rust. Keep in mind that you can still screw up security in Rust, but it avoids a lot of old memory problems.