Live data from Hacker News

Embedded Rust or C firmware? Lessons from an industrial microcontroller use case

arxiv.org

31–40 of 172 posts

Re: Embedded Rust or C firmware? Lessons from an industrial microcontroller use case

#31
post #16
post #2

Authors are from STMicro, polytechnic Turin, Freie universitat Berlin, and Inria. Examined writing firmware for an IOT sensor platform. From the abstract: > Two teams concurrently developing the same functionality (one in C, one in Rust) are analyzed over a period of several months. A comparative analysis of their approaches, results, and iterative efforts is provided. The analysis and measurements on hardware indica…

[flagged]

Rust is much more stable than C in my experience. Try compiling a decade old C code and see how that goes...

Re: Embedded Rust or C firmware? Lessons from an industrial microcontroller use case

#32
post #16
post #2

Authors are from STMicro, polytechnic Turin, Freie universitat Berlin, and Inria. Examined writing firmware for an IOT sensor platform. From the abstract: > Two teams concurrently developing the same functionality (one in C, one in Rust) are analyzed over a period of several months. A comparative analysis of their approaches, results, and iterative efforts is provided. The analysis and measurements on hardware indica…

[flagged]

> Rust is evolving far too fast to be used in code which needs to run for years to decades down the line.

Code doesn’t stop running on existing hardware when the language changes in a future compiler. You can still use the same old toolchain.

I’ve done a lot of embedded development in a past life. Keeping old tool chains around for each old platform was standard.

I would much rather go through the easy process of switching to an older Rust tool chain to build something than all of the games we played to keep entire VMs archived with a snapshot of a vendor tool chain that worked to build something.

Re: Embedded Rust or C firmware? Lessons from an industrial microcontroller use case

#33
post #16
post #2

Authors are from STMicro, polytechnic Turin, Freie universitat Berlin, and Inria. Examined writing firmware for an IOT sensor platform. From the abstract: > Two teams concurrently developing the same functionality (one in C, one in Rust) are analyzed over a period of several months. A comparative analysis of their approaches, results, and iterative efforts is provided. The analysis and measurements on hardware indica…

[flagged]

Wait, are you implying that code written in Rust somehow "rusts"?

Re: Embedded Rust or C firmware? Lessons from an industrial microcontroller use case

#34
post #28

Earlier quoted context omitted.

Can you point at any piece of code from 5 years ago that doesn't work today?

I only tried Rust for small hobby projects, but I did experience weird code rot when you just leave the code there and after a while it does not compile. Might have something to do with how Cargo manages dependencies

> Might have something to do with how Cargo manages dependencies

Build against the lockfile to use the same versions.

Unless they were pulled from upstream, they won’t suddenly stop building against the same compiler version. Rustup makes it easy to switch compiler versions to get back to the same one you used, too.

Re: Embedded Rust or C firmware? Lessons from an industrial microcontroller use case

#35
post #16
post #2

Authors are from STMicro, polytechnic Turin, Freie universitat Berlin, and Inria. Examined writing firmware for an IOT sensor platform. From the abstract: > Two teams concurrently developing the same functionality (one in C, one in Rust) are analyzed over a period of several months. A comparative analysis of their approaches, results, and iterative efforts is provided. The analysis and measurements on hardware indica…

[flagged]

Isn't that (part of) the purpose of using something like Ariel OS, to isolate you from changes?

Re: Embedded Rust or C firmware? Lessons from an industrial microcontroller use case

#37
post #28

Earlier quoted context omitted.

Can you point at any piece of code from 5 years ago that doesn't work today?

I only tried Rust for small hobby projects, but I did experience weird code rot when you just leave the code there and after a while it does not compile. Might have something to do with how Cargo manages dependencies

I've had issues compiling Python 3.12 on ArchLinux when Python 3.12 -> Python 3.13 happened, and few of important packages broke. So I had to compile older version of gcc and build Python 3.12

So, it can happen in any programming language, and to any large projects.

Rust allows me to handle this easily with rust.toolchain file, so, this concern is kinda overblown imo

Re: Embedded Rust or C firmware? Lessons from an industrial microcontroller use case

#38
post #16
post #2

Authors are from STMicro, polytechnic Turin, Freie universitat Berlin, and Inria. Examined writing firmware for an IOT sensor platform. From the abstract: > Two teams concurrently developing the same functionality (one in C, one in Rust) are analyzed over a period of several months. A comparative analysis of their approaches, results, and iterative efforts is provided. The analysis and measurements on hardware indica…

[flagged]

I think that was true maybe 5-10 years ago.

We have Rust code in a living code base that is more than 5 years old and it's required maybe one touch in the last 5 years to fix some issues due to stricter rules. It was simple enough it could have been automated.

Re: Embedded Rust or C firmware? Lessons from an industrial microcontroller use case

#39
post #28

Earlier quoted context omitted.

Can you point at any piece of code from 5 years ago that doesn't work today?

I only tried Rust for small hobby projects, but I did experience weird code rot when you just leave the code there and after a while it does not compile. Might have something to do with how Cargo manages dependencies

This is not a Rust issue but an inherent issue with dependencies in all languages. External dependencies rot.

For Rust code for serious industrial use cases or firmwares, it's always best to minimize dependencies as much as possible to avoid this. Making local copies of dependencies is also a thing for certain use cases.

Re: Embedded Rust or C firmware? Lessons from an industrial microcontroller use case

#40
post #16
post #2

Authors are from STMicro, polytechnic Turin, Freie universitat Berlin, and Inria. Examined writing firmware for an IOT sensor platform. From the abstract: > Two teams concurrently developing the same functionality (one in C, one in Rust) are analyzed over a period of several months. A comparative analysis of their approaches, results, and iterative efforts is provided. The analysis and measurements on hardware indica…

[flagged]

> Rust is evolving far too fast

I'm curious why I've seen this sentiment repeated in so many places, I learned Rust once 5 years ago and I haven't had to learn any new idioms and there have been no backwards incompatible changes to it that required migrating any of my code.

Post reply on HN