Why learning Rust is worthwhile for engineers

In the world of software development, Rust is a fast-growing language known for its security and performance. This article is aimed at engineers in computer-aided engineering, doctoral students in engineering programs and all other interested engineers who either work primarily with MATLAB or Python or are faced with the decision of which programming language to learn. The article highlights why Rust is worth a look - especially for interdisciplinary projects between engineering and software development, for example in simulation, optimization or data preparation and visualization. The article is divided into the following sections:

After reading you have:

  • Reasons why it makes sense to learn Rust as an engineer
  • Understood why it is better to learn Rust than another language in the medium term
  • A good idea why Rust offers enormous advantages, especially for security-relevant software
  • Further resources to help you learn Rust in an application-oriented way.

What is Rust and what are the differences to other programming languages?

Rust is a modern, system-oriented programming language that is known for its performance and security. Developed with the aim of overcoming the weaknesses of more traditional languages such as C and C++, Rust places a particular focus on security, speed and concurrent programming. Unlike languages such as Python and MATLAB, which are often praised for their simplicity and rapid development capabilities, Rust offers a more robust environment for developing software.

To defy the praise for the simplicity of these languages, I would like to discuss the learning curve here. Rust's learning curve is often perceived as very steep. In my opinion, there are two reasons for this:

  1. Most learning materials are designed for learning through books or examples
  2. The learning materials focus on complex concepts such as ownership, borrow-checking and lifetimes at an early stage instead of solving application problems.

Not many people realize that there is an intersection in the learning curves of Rust and other languages: Everyone will have a different subjective perception of where this is, but Rust's strong type system alone helps with many programming challenges. At the latest when you want to exploit the parallel capability of computers, then the learning curve of Rust develops in comparison to other programming languages as shown in the figure:

Figure 1- Learning curves, Rust versus other languages. Initially a higher learning effort, but the concepts learned also work without special cases for complex software solutions.

This means that other programming languages, such as Python and MATLAB, are more effective as long as you remain at a low learning progress (left on the x-axis). As soon as it comes to implementing something more complex, Rust can show its advantages and this does not have to be parallelization. It can be a code base with several files and functions in which the overview is lost due to the dynamic type system. And if parallelization is used later, then you are ideally equipped with the concepts you have learned in Rust.

Does this mean that you should learn Rust instead of Python or MATLAB if you are faced with the choice?

Short Answer without knowing your situation: If you have time to learn a programming language then Rust is probably the best programming language you can currently choose.

But, of course, we should consider your situation, which I don't know. Good questions are:

  • Does my (new) employer mainly use source code in another language?
  • How far along is the Rust ecosystem in the area I want to work in and does it fit in with my goals? Maybe you can get involved in an open source project during your doctorate. Information on this can be found on sites like:

If you would like to take a look, I will also link the first video of the "Pragmatic Rust for Engineers" series here on December 5, 2023.

Why are so many programmers so enthusiastic about Rust?

Programmers are excited about Rust for several reasons, but three main aspects stand out: Cargo, the excellent tool and package management system for Rust. The clear, helpful error messages that support Rust's focus on security and efficiency. As well as the strong standard library with excellent best practices for robust software. The following meme explains it perfectly:

Figure 2 - Meme in relation to the movie Matrix - Both pills 'safety/red' and performance/blue' taken.

Nevertheless, here are further paragraphs on the three main aspects.

Cargo - Modern tools and excellent package manager

Cargo Cargo is one of the most powerful tools in the Rust ecosystem. It serves not only as a package manager, but also as a build system and includes a variety of features that make a developer's life easier. Compared to dynamic languages like Python, Cargo provides an integrated, consistent environment for building, testing and managing dependencies. It automatically manages all dependencies and their versions, drastically reducing the risk of compatibility issues or "dependency hell". Cargo also enables smooth integration of third-party libraries, making it easier to work on complex projects.

Clear error messages and borrow checking

Another reason for the enthusiasm surrounding Rust is its approach to error handling. Rust is known for its precise and helpful error messages. This is especially important as Rust uses a strict borrow-checking system that ensures references and pointers are handled correctly. These error messages are not only clear, but often didactic, offering suggestions for troubleshooting and explanations to better understand the language concepts. The result is a learning process that helps programmers develop safe and performant programs. This type of support is not available in this form in dynamic languages such as Python and represents a significant added value for developers interested in developing reliable and maintainable code.

Strong standard library and excellent best practices for error handling

Another aspect that makes Rust particularly attractive to developers is its extensive and well-designed standard library. This library offers a rich set of functionalities, from basic data types to complex structures and algorithms, allowing developers to write robust programs without having to rely on external libraries.

The integration of crates such as thiserror and anyhow in Rust projects exemplifies the best practices promoted in the Rust community. thiserror is designed for simplified creation and management of custom error types, contributing to code clarity and maintainability. anyhow, on the other hand, provides straightforward and flexible error handling, which is particularly useful in situations where the specific nature of the error is less relevant. These tools not only promote clean and efficient error handling, but also improve the readability and maintainability of the code.

In combination, the strong standard library and these specialized crates enable developers to write high-quality, reliable and maintainable code that is efficient in both development and maintenance. The integration of these best practices into the development process is another reason why Rust is becoming increasingly popular in the programming community.

I use Python or Matlab, why should I learn Rust?

That is very good. Many software solutions started with a scripting language. For example, the first versions of Facebook were developed in PHP before the backend was switched to C++ (Blog Post von 2010). Rust is a great addition to your repertoire. Rust allows you to develop powerful modules that can interact directly with Python or MATLAB, thanks to tools like the Crate pyo3. This not only expands your technical capabilities, but also strengthens your role in interdisciplinary teams by building a bridge between different technical disciplines

Personally, I think the most important reason is that you will be even more interdisciplinary. Thanks to your experience, you will be an ideal interface between your domain knowledge and the software developers working in or with your company. In the 1990s, the software industry simplified communication with customers thanks to the concept of object-oriented programming. Unfortunately, from a software architecture perspective, a 1-to-1 mapping of the customer domain is rarely the best solution.

Figure 3 - A major challenge in technical interdisciplinary projects is to find employees who speak the language of different technical areas. - Image Source Pixabay – by “Geralt“

Structure and design are crucial in the development of complex software projects. The term object orientation was coined with these requirements in mind. This is a set of approaches and some of them, like inheritance, quickly lead to more problems than good design. There is a strong backlash against inheritance as it is currently used in many object-oriented languages, for example read this blog post. In contrast to traditional object-oriented programming languages, which allow and advertise complex inheritance hierarchies, Rust offers a simpler and clearer approach with 'traits'.

In addition, Rust offers advantages in terms of time-to-market without compromising on performance or safety. This makes Rust particularly attractive for projects in sectors such as automotive, aerospace or chemical plant control, where reliability and performance are critical. Rust's growing popularity in the industry confirms its value and versatility, making it a smart choice for forward-thinking engineers.

Rust for safety-critical software

Rust is playing an increasingly important role in the development of safety-critical software, particularly due to the safety guarantees it provides at compile time. Technically, these guarantees are based on concepts such as the Ownership Model, the Borrow Checker and Lifetimes, which are explained, for example, in the Rust Book erklärt werden. Außerdem ist und wird Rust für viele Sicherheitsspezifikationen, wie die Normen wie ISO 26262 für die Automobilsoftware oder DO-178C für luftfahrttechnische Software, zetifiziert.

An excellent example of this is Ferrocene, a compiler for Rust that has been specially designed for the development of safety-critical systems. Ferrocene guarantees compliance with strict security standards. By integrating Ferrocene into the development process, teams can make compliance with relevant security standards more efficient while increasing the reliability of their software.

Another example is PXROS from HighTec EDV Systeme GmbH, which has a history in the automotive market for safety-critical software and has developed a real-time-Operating system - PXROS that also offers a Rust development platform. An interesting fact is that PXROS only allows one task to access one data object at a time. To transfer access to data between tasks, a messaging system is used that is conceptually similar to Rust's ownership model.

Figure 4 - Safety-critical industries such as chemicals/medicine, transportation and the energy industry will benefit greatly from Rust in the future.

The use of Rust and specialized compilers such as Ferrocene in safety-critical applications has a significant impact on specification checking. The ability to map many aspects of safety verification in the toolchain and rely on Rust with its guarantees reduces the effort and complexity of complying with safety standards, improves the overall quality and reliability of the software and enables faster iteration cycles. This makes Rust an increasingly important choice for projects in industries where security is of paramount importance.

At this point, I would like to list a few more articles that highlight the advantages of Rust:

Conclusion: Rust as a bridge in interdisciplinary engineering work

For engineers working at the interface between engineering and software development, learning Rust is a valuable investment. Rust not only expands the technical repertoire, but also enables more effective communication and collaboration in interdisciplinary teams. By mastering this modern, systems-oriented language, you can transcend the limitations of Python and MATLAB and face the challenges of today's software landscape, especially in safety-critical areas, with more confidence. In short, Rust not only enriches your skills with a powerful programming language, but also opens up new avenues for collaboration and innovation. The time invested in Rust will pay off in improved software quality, increased efficiency and expanded opportunities in interdisciplinary technology development.

If you want to start learning Rust soon, I'm happy to announce that a video series "Pragmatic Rust for Engineers" will be released in December 2023 and linked here. This will provide you with a highly application-oriented introduction that will quickly teach you to solve differential equations, visualize data and use interactive elements in Rust. I would be happy to have you as a viewer.

Leave a Reply