Software engineers at carmaker Volvo have detailed why they are fans of the Rust programming language, arguing that Rust is actually “good for your car.”
It seems everyone loves Rust, from Microsoft’s Windows and Azure teams to Linux kernel maintainers, Amazon Web Services, Meta, the Android Open Source Project and more. And now it seems it’s time to add software engineers at Volvo to that list.
Julius Gustavsson, a technical expert and systems architect at Volvo Cars Corporation, explains “why rust is actually good for your car” in an interview on Medium with his Volvo software engineer Johannes Foufas.
Rust is a relatively young language that helps developers avoid memory-related bugs that C and C++ don’t automatically cause, hence Rust’s growing popularity in systems programming. According to the Microsoft and Google Chrome team, memory-related errors are the most common serious security issues.
Gustavsson brings a perspective from the development of embedded systems to the debate.
Volvo and the auto industry in general are striving for “software-defined cars” to individualize, differentiate and enhance vehicles after they leave the truck stop.
The main advantages he sees from Rust are: no worries about race conditions and memory corruption, and memory security in general. “You know, just write correct and robust code from the start,” he said.
Gustavsson says he started bringing Rust into Volvo with the core computer’s low-power node.
Gustavsson sees Volvo as a bright future for Rust, but that doesn’t mean it should be used to replace already working code that has been adequately tested. He notes that new Rust code can co-exist with existing C and C++ at “almost any granularity,” and that it might make sense to pick pieces to rewrite Rust if that component needs cybersecurity.
“We want to extend Rust here at Volvo Cars to enable it on more nodes and to do that we need compiler support for certain hardware targets and OS support for other targets. There’s no point in replacing code that’s already developed and well-tested, but code developed from the ground up should definitely be developed in Rust if at all possible.
“That’s not to say Rust is a panacea. Rust still has some rough edges and requires you to make certain compromises that may not always be the best course of action. But overall, I think Rust has tremendous potential for us to produce better quality code up front at a lower cost, which in turn would lower our warranty costs, so it’s a win-win for the bottom line,” he said.
Volvo isn’t the only automaker interested in Rust. Autosar, an automotive standards group — whose members include Ford, GM, BMW, Bosch, Volkswagen, Toyota, Volvo and many more — announced in April a new subgroup within its Functional Safety Working Group (WG-SAF) to investigate How Rust do this could be used in one of its reference platforms. SAE International also set up a task force to investigate Rust in the automotive industry for safety-related systems.
Rust was also in the news with Microsoft Azure Chief Technology Officer Mark Russinovich, who said developers should avoid using C or C++ programming languages in new projects and use Rust instead.