Table of Contents
Abandon C and C, turn to Rust, just for memory safety
In addition to Rust, what other memory-safe programming languages ​​​​
Home Technology peripherals AI The White House issued a document calling on developers to abandon C and C++: Rust was 'hand-picked' for memory safety

The White House issued a document calling on developers to abandon C and C++: Rust was 'hand-picked' for memory safety

Mar 01, 2024 pm 10:16 PM
ai Model overflow

Recently, the White House Office of the National Cyber ​​Director (ONCD) made an important point in a 19-page report: developers should use memory-safe programming languages, such as the Rust language. The report points out that choosing a memory-safe programming language is a key way to ensure that software is developed in a secure-by-design manner.

ONCD also pointed out that the recommendations in the report were developed in collaboration with technology companies, academia and other institutions, and have the support of a number of well-known technology companies, including HP, Accenture and Palantir.

The White House issued a document calling on developers to abandon C and C++: Rust was hand-picked for memory safety

Report address: https://www.whitehouse.gov/wp-content/uploads/2024/02/Final-ONCD-Technical- Report.pdf

In fact, this is not the first time that an official US agency has called for the abandonment of C and C.

Last December, the U.S. Cybersecurity and Infrastructure Agency (CISA), together with other agencies, released a "Memory Security Roadmap Guidance", pointing out C and C as memory incompatible Safe programming languages ​​emphasize that software developers should adopt other memory-safe programming languages ​​such as Rust and Java. The purpose of this guide is to increase awareness of memory safety issues in software development and encourage the adoption of more reliable programming languages ​​to reduce potential security vulnerabilities. CISA specifically emphasizes the importance of adopting memory-safe programming languages ​​as this helps reduce the risk of malicious attacks and data leaks. This move is also to promote the development of the software development industry in a more secure and reliable direction,

The White House issued a document calling on developers to abandon C and C++: Rust was hand-picked for memory safety

Source: https://www.cisa.gov /sites/default/files/2023-12/The-Case-for-Memory-Safe-Roadmaps-508c.pdf

Abandon C and C, turn to Rust, just for memory safety

It is important to emphasize the use of memory-safe programming languages ​​because memory safety prevents problems such as buffer overflows and dangling pointers, which can lead to bugs and vulnerabilities. Therefore, it is crucial to understand the concept of memory safety.

How harmful is memory insecurity? In 2019, Microsoft security engineers reported that approximately 70% of security issues were caused by memory safety issues. In 2020, Google reported similar data for bugs discovered in the Chromium browser.

For programming languages, both C and C allow arbitrary pointer arithmetic using direct memory addresses without bounds checking. The report states that experts have found some programming languages, represented by C and C, that both lack memory safety-related features and are highly pervasive in some critical systems. Therefore, C and C are considered "unsafe" programming languages.

Corresponding to C and C, Rust is considered a classic example of a memory-safe programming language. Rust is a systems programming language focused on safety, especially concurrency safety. It supports multi-paradigm languages ​​such as functional, imperative and generic programming paradigms, and deep learning frameworks such as TensorFlow also use it as an excellent front-end language.

The White House issued a document calling on developers to abandon C and C++: Rust was hand-picked for memory safety

In the 2021 annual developer survey report of the programmer question and answer website Stack Overflow, the Rust language became the most popular programming language among developers. One of the reasons Rust is popular in the systems programming world is that it can help eliminate memory-related security vulnerabilities.

The White House issued a document calling on developers to abandon C and C++: Rust was hand-picked for memory safety

Rust’s memory safety features have long been verified by the industry. In April 2021, Google announced that Android would add support for the Rust language. The reason is that memory safety bugs in C and C are the most difficult sources of bugs to solve, and Google has invested a lot of effort and resources to detect, fix and mitigate such bugs, and effectively prevent a large number of bugs from entering Android versions.

However, despite these efforts, memory safety bugs remain the primary cause of stability issues, chronically accounting for approximately 70% of Android's critical security vulnerabilities. Therefore, Google added a 3rd option, Rust, for operating system developers.

Dan Grossman, professor of computer science at the University of Washington, said that for decades, everyone has understood the dangers of C and C, and now it is finally a good time to promote memory-safe programming languages. After all, there are practical and mature ones. alternative plan.

He also believes that getting rid of C and C will not be accomplished overnight, especially in embedded systems. However, this process is expected to accelerate as other programming languages ​​such as Rust become more widely used in systems software.

Regarding the official attitude towards C and C, more people don’t seem to buy it.

Some people think that modern C is memory safe, and all operating systems are programmed in C or C. Some people also believe that even though C is not memory safe, modern C has more "guardrails" and is low-cost or even free of charge.

The White House issued a document calling on developers to abandon C and C++: Rust was hand-picked for memory safety

The White House issued a document calling on developers to abandon C and C++: Rust was hand-picked for memory safety

For Rust, which has been "handpicked" for memory safety, some people feel that its level of support is not that high. , nor worthy of integration into government systems.

The White House issued a document calling on developers to abandon C and C++: Rust was hand-picked for memory safety

In addition to Rust, what other memory-safe programming languages ​​​​

November 2022, United States National The National Security Agency (NSA) has published a cybersecurity information sheet detailing the programming languages ​​it considers memory safe

  • Rust
  • Go
  • ##C
  • #Java
  • Swift
  • JavaScript
  • Ruby
  • Python
  • Delphi/Object Pascal
  • Ada

How popular are the above programming languages? The programming language popularity index TIOBE in February 2024 shows that in terms of programming, Python ranks first, C# ranks fifth, Java ranks fourth, JavaScript ranks sixth, Go ranks eighth, and Delphi/Object Pascal ranks 12th. Swift ranked 16th, Rust ranked 18th, and Ruby barely ranked 20th.

As you can see, most of the languages ​​selected by the NSA are in the top 20, only Ada is not in the top 10, but there are only 5 in the top ten.

The White House issued a document calling on developers to abandon C and C++: Rust was hand-picked for memory safety

Source: https://www.tiobe.com/tiobe-index/

The report also calls for better measurement of software security. ONCD believes: Better metrics enable technology providers to better plan for, predict and mitigate vulnerabilities before they become a problem.

The report also reviews the Apollo 13 mission, which NASA classified as a "successful failure." The mission itself suffered a catastrophic failure, and the three astronauts made temporary repairs and mitigated some of the problems in order to return home safely. The report states: Memory security codes are very important to the space program. Human exploration of space should use a memory-safe language, a language that is as close to the kernel as possible to avoid future accidents.

As more and more of the world becomes digital, better coding becomes increasingly important, and bad code can be used maliciously.

Rust Language

Rust language is a general-purpose, compiled programming language led by Mozilla. The design criteria are "safety, concurrency, and practicality" and supports functional, concurrent, procedural, and object-oriented programming styles.

The most prominent advantage of the Rust language is that it can provide memory safety guarantees without additional performance loss. In the development process of traditional system-level programming languages ​​(C/C++), crashes or bugs caused by various memory errors often occur, such as null pointers, wild pointers, memory leaks, memory out-of-bounds, segfaults, data races, and iterations. Device failure, etc.

Memory problems are a major hidden danger affecting program stability and security, and are a major factor affecting development efficiency. The two major technology giants Google and Microsoft have stated that 70% of program security issues in their important products are caused by memory issues, and both giants are considering using the Rust language to solve memory safety issues.

In addition, Rust also has excellent cross-platform capabilities, supports cross-compilation, and is also friendly to embedded environments.

However, the Rust language also has some tricky shortcomings.

First of all, due to some special syntax in Rust, it is slightly difficult for beginners to get started, such as "lifetime". In comparison, languages ​​such as Python and Java are simpler and easier to learn. But if you already know the C language, learning the Rust language is much easier because it borrows a lot of C syntax.

Secondly, the compiler checking of the Rust language is very strict, and most of the development process is spent solving compilation problems. However, once the compilation is passed, developers do not need to worry about memory safety, memory leaks and other headaches, and only need to focus on business logic.

The above is the detailed content of The White House issued a document calling on developers to abandon C and C++: Rust was 'hand-picked' for memory safety. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

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)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to solve mysql cannot be started How to solve mysql cannot be started Apr 08, 2025 pm 02:21 PM

There are many reasons why MySQL startup fails, and it can be diagnosed by checking the error log. Common causes include port conflicts (check port occupancy and modify configuration), permission issues (check service running user permissions), configuration file errors (check parameter settings), data directory corruption (restore data or rebuild table space), InnoDB table space issues (check ibdata1 files), plug-in loading failure (check error log). When solving problems, you should analyze them based on the error log, find the root cause of the problem, and develop the habit of backing up data regularly to prevent and solve problems.

Can mysql return json Can mysql return json Apr 08, 2025 pm 03:09 PM

MySQL can return JSON data. The JSON_EXTRACT function extracts field values. For complex queries, you can consider using the WHERE clause to filter JSON data, but pay attention to its performance impact. MySQL's support for JSON is constantly increasing, and it is recommended to pay attention to the latest version and features.

Understand ACID properties: The pillars of a reliable database Understand ACID properties: The pillars of a reliable database Apr 08, 2025 pm 06:33 PM

Detailed explanation of database ACID attributes ACID attributes are a set of rules to ensure the reliability and consistency of database transactions. They define how database systems handle transactions, and ensure data integrity and accuracy even in case of system crashes, power interruptions, or multiple users concurrent access. ACID Attribute Overview Atomicity: A transaction is regarded as an indivisible unit. Any part fails, the entire transaction is rolled back, and the database does not retain any changes. For example, if a bank transfer is deducted from one account but not increased to another, the entire operation is revoked. begintransaction; updateaccountssetbalance=balance-100wh

Master SQL LIMIT clause: Control the number of rows in a query Master SQL LIMIT clause: Control the number of rows in a query Apr 08, 2025 pm 07:00 PM

SQLLIMIT clause: Control the number of rows in query results. The LIMIT clause in SQL is used to limit the number of rows returned by the query. This is very useful when processing large data sets, paginated displays and test data, and can effectively improve query efficiency. Basic syntax of syntax: SELECTcolumn1,column2,...FROMtable_nameLIMITnumber_of_rows;number_of_rows: Specify the number of rows returned. Syntax with offset: SELECTcolumn1,column2,...FROMtable_nameLIMIToffset,number_of_rows;offset: Skip

How to optimize MySQL performance for high-load applications? How to optimize MySQL performance for high-load applications? Apr 08, 2025 pm 06:03 PM

MySQL database performance optimization guide In resource-intensive applications, MySQL database plays a crucial role and is responsible for managing massive transactions. However, as the scale of application expands, database performance bottlenecks often become a constraint. This article will explore a series of effective MySQL performance optimization strategies to ensure that your application remains efficient and responsive under high loads. We will combine actual cases to explain in-depth key technologies such as indexing, query optimization, database design and caching. 1. Database architecture design and optimized database architecture is the cornerstone of MySQL performance optimization. Here are some core principles: Selecting the right data type and selecting the smallest data type that meets the needs can not only save storage space, but also improve data processing speed.

The primary key of mysql can be null The primary key of mysql can be null Apr 08, 2025 pm 03:03 PM

The MySQL primary key cannot be empty because the primary key is a key attribute that uniquely identifies each row in the database. If the primary key can be empty, the record cannot be uniquely identifies, which will lead to data confusion. When using self-incremental integer columns or UUIDs as primary keys, you should consider factors such as efficiency and space occupancy and choose an appropriate solution.

Navicat's method to view MongoDB database password Navicat's method to view MongoDB database password Apr 08, 2025 pm 09:39 PM

It is impossible to view MongoDB password directly through Navicat because it is stored as hash values. How to retrieve lost passwords: 1. Reset passwords; 2. Check configuration files (may contain hash values); 3. Check codes (may hardcode passwords).

Monitor MySQL and MariaDB Droplets with Prometheus MySQL Exporter Monitor MySQL and MariaDB Droplets with Prometheus MySQL Exporter Apr 08, 2025 pm 02:42 PM

Effective monitoring of MySQL and MariaDB databases is critical to maintaining optimal performance, identifying potential bottlenecks, and ensuring overall system reliability. Prometheus MySQL Exporter is a powerful tool that provides detailed insights into database metrics that are critical for proactive management and troubleshooting.

See all articles