Wavebreakmedia Dreamstime_48965570
Lab Bench Promo Wavebreakmedia Dreamstime Xxl 48965570 64beca9721ef3

Delivering Reliable, Rugged Rust

July 24, 2023
Though it’s a relatively new programming language, Rust is now ready for prime time.

This article is part of the TechXchange: Rusty Programming.

Rust is a somewhat new programming language that’s designed to reduce the number of common errors by providing a more restrictive and descriptive programming environment. It’s built to compete with C in performance while significantly minimizing the number of errors a programmer might accidentally include in an application.

Several aspects of Rust make it more robust than C, such as tracking memory utilization, including pointers. The Rust borrow checker forces the programmer to explicitly control the use of memory references, thereby preventing many of the most common errors found in C programs.

Though Rust is a general programming language, it can also be used for bare-metal and operating system implementations where C is dominant. The challenge in using Rust these days is that the open-source project continues to evolve the language. While that’s great for improving the language, it can wreak havoc on programmers who need to support applications on a long-term basis.

Rust implements much of its error checking at compile time using static analysis. MISRA C also uses static analysis, but C doesn’t provide the ability to describe how things like memory are controlled with respect to pointer usage. MISRA C is used in markets such as automotive, although Rust is much more robust in allowing programmers to define how memory references are manipulated. Rust still lacks features like contracts found in Ada/SPARK, but Rust’s memory reference tracking is superior.

Two companies, Ferrous Systems and AdaCore, are at the forefront of Rust support for applications that need qualified versions of the compiler and tools to meet standards requirements. Standards include ISO 26262 and IEC 61508 as well as the more demanding DO-178C, ISO 21434, and IEC 62278.

Ferrous Systems’ solution is called Ferrocene, and AdaCore has the GNAT Pro for Rust, which is based on its GNAT Pro tool series that supports C, C++, Ada, and SPARK development. These tools target high-quality, high-reliability software applications but are equally suitable for developing any embedded application. AdaCore provides Ada-Rust bidirectional bindings that allow for mixed language application implementations. AdaCore is an ISO 9001-compliant and NIST SP 800-171 organization targeting SLSA Build Level 3 compliance.

The main difference between the open-source version of Rust and the commercial versions are the level of support, including bug fixes and long-term support. Both companies have a track record of supporting safety and security environments from automotive to avionics.

Using Rust can be a challenge given C’s dominance, but there are Rust drivers in Linux now. Rust is ideal for implementing drivers, operating systems, and bare-metal applications where high-quality software is paramount to safety and security.

Watch Embeddable Rust

Take a Quick Poll

Scroll down to add a comment.

About the Author

William G. Wong | Senior Content Director - Electronic Design and Microwaves & RF

I am Editor of Electronic Design focusing on embedded, software, and systems. As Senior Content Director, I also manage Microwaves & RF and I work with a great team of editors to provide engineers, programmers, developers and technical managers with interesting and useful articles and videos on a regular basis. Check out our free newsletters to see the latest content.

You can send press releases for new products for possible coverage on the website. I am also interested in receiving contributed articles for publishing on our website. Use our template and send to me along with a signed release form. 

Check out my blog, AltEmbedded on Electronic Design, as well as his latest articles on this site that are listed below. 

You can visit my social media via these links:

I earned a Bachelor of Electrical Engineering at the Georgia Institute of Technology and a Masters in Computer Science from Rutgers University. I still do a bit of programming using everything from C and C++ to Rust and Ada/SPARK. I do a bit of PHP programming for Drupal websites. I have posted a few Drupal modules.  

I still get a hand on software and electronic hardware. Some of this can be found on our Kit Close-Up video series. You can also see me on many of our TechXchange Talk videos. I am interested in a range of projects from robotics to artificial intelligence. 

Sponsored Recommendations

Comments

To join the conversation, and become an exclusive member of Electronic Design, create an account today!