Rust & AI for more efficiency in automotive development

Digital Methods & Tools

28.5.2025

Anything but rusty

The Rust programming language combines security and convenience of modern languages without compromising on the performance of traditional system languages such as C and C++. Together with the use of LLMs in traditional languages, this opens up further efficiency potential for automotive development.

Rust is a programming language that has been in development since 2009 and was first presented to the public in 2010. Since then, Rust has quickly surged in popularity and has been the fastest-growing programming language of all over the past five years, as developers are particularly fond of its combination of performance and security. A rapidly growing community and an ecosystem with numerous libraries and tools has grown up around the language. Large technology companies such as Google, Mozilla, Microsoft, Amazon, and Facebook use Rust in a variety of projects, including security-critical applications and for system software.

One reason for the popularity of Rust is its increased security compared to C or C++, particularly by avoiding errors in memory access. Rust eliminates these issues through an ‘ownership system’ that establishes strict rules for memory access. For example, each variable in Rust has a specific memory area assigned to it—which it must then release when it is no longer needed. This happens automatically when the variable leaves its scope. Security is also increased for the use of references to memory areas: In Rust, they are given lifetimes. This is meant to ensure that references never point to invalid memory areas. Race conditions (races for access to resources) between different execution threads of a program are also avoided by the ownership system—here the keyword is ‘concurrency security’.

Despite the increased security, developers at Rust don’t have to compromise in terms of performance. In many cases, the programming language can keep up with the speed of C and C++. This combination of security and performance makes Rust particularly attractive for the development of system software, real-time applications, and other projects with high performance requirements.

Another advantage of the programming language is the mature Rust toolchain. The integrated package management system ‘Cargo’ and the robust test system make software development efficient. Developers can quickly and easily start new projects, manage dependencies, and carry out extensive tests. This facilitates collaboration in teams and promotes a clean, structured code base. The high esteem in which Rust is held is also demonstrated by its use as a programming language for the core of the Linux operating system, in which performance and security play a key role and which has hitherto been programmed in C.

Growing interest

In the automotive industry, interest in Rust is continually growing, as the combination of memory security, efficiency, and concurrency security makes the programming language well suited for use in safety-critical embedded systems for vehicles. Porsche Engineering has already gained experience with it. “We started our first project with Rust in January, the object of which is to program the core of a data collector framework that we want to offer to third parties as a software-as-a-service,” states Dr. Heiko Helble, Specialist Project Manager for ADAS Software Development at Porsche Engineering. “Cybersecurity plays an important role for us in that—and that’s exactly why we chose Rust.”

Like many other experts, Helble appreciates that the programming language solves typical problems such as unauthorized memory access and ensures the consistent use of physical units through its data types—it is not possible, for example, to enter the speed in meters per second at one point and then in kilometers per hour at another point. “This only minimally increases the programming effort, but significantly accelerates testing and troubleshooting,” says Helble.

Combination with an LLM

A relatively new trend in software development is the combination of manual and AI-supported programming, for example using Large Language Models (LLMs). The programmer assigns a sub-task to an LLM and the AI then provides the source code. In principle, this is possible with any programming language, provided that the AI model has been trained with enough examples. “Although Rust is much younger than C and there is consequently much less training data, it already works very well,” as Helble reports. “With an LLM, I solved a very complex task on the first go in 20 minutes for which I would have normally needed several hours. The software was immediately operable.”

This type of AI-supported programming in languages such as C or C++ is already successfully being used at Porsche Engineering. “LLMs offer us valuable support in solving subtasks,” reports Jonas Brandstetter, Development Engineer at Porsche Engineering. “This might be, for example, communication with peripheral hardware via particular interfaces. In the future, however, we could start with the customer’s requirements, generate the tasks for the LLM from them, and ultimately get to the code that way.” The key when using LLMs in software development is protecting confidential data. For this reason, Porsche Engineering uses internally accessible solutions that are based on LLMs but meet all data protection requirements.

Info

Text first published in the Porsche Engineering Magazine, issue 2/2024.

Text: Christian Buck
Illustration: Benedikt Rugar

Copyright: All images, videos and audio files published in this article are subject to copyright. Reproduction in whole or in part is not permitted without the written consent of Porsche Engineering. Please contact us for further information.

Contact

You have questions or want to learn more? Get in touch with us: info@porsche-engineering.de