Live data from Hacker News

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

arxiv.org

11–20 of 172 posts

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

#11
post #8

off topic question: why is there no source attached to this paper?

"The open source code will be published on https://github.com/stm32-hotspot/ for the final version of the paper."

-> paper is not final. And IIUC ST will be releasing the code at some point.

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

#13

One of the author's here, if there are any questions!

Nice to see serial comms supported. Are I2S and CAN on the roadmap? Do you see any sensor module suppliers support ArielOS?

1. So Ariel OS is based on Embassy - IIUC I2S and CAN has some support upstream. That can be used already, although not using Ariel's usually fully portable APIs.

2. Well, ST has released official Rust drivers for a bunch of their sensors. They're built on embedded-hal(-async), so can directly be used with Ariel OS. There is probably more.

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

#14
post #7

Earlier quoted context omitted.

Isn't there a nasty selection/volunteer bias at play with the developers?

You mean with the "two teams" that were tasked to develop the C / Rust versions? Yeah of course. Then again - they were one person teams, where the C "team" had years of experience in stm32 / embedded C / stm32 cube development and churned out that handwritten state machine in just days. The Rust "team" was a pre-masters intern with only minimal embedded Rust experience. They ran into all the pitfalls with (async) em…

That does not seem like even close to a fair comparison and makes me wonder how valid the conclusion is. Effectively this is two times n=1, if you use 'teams' when you actually mean 'individuals' then that's not really proper reporting.

I do applaud you for having the same work done twice but it would have been far more meaningful to have two actual teams of seasoned developers do this sort of thing side-by-side. The biggest item on the checklist would be the number of undiscovered UB or UB related bugs in the C codebase and to compare that with the Rust codebase on 'defect escape rate' or some other meaningful metric.

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

#15
post #8

off topic question: why is there no source attached to this paper?

"The open source code will be published on https://github.com/stm32-hotspot/ for the final version of the paper." -> paper is not final. And IIUC ST will be releasing the code at some point.

nope, I was meaning the TeX source for the paper

https://info.arxiv.org/help/faq/whytex.html

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

#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]

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

#17
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.

That statement deserves support.

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

#18

Earlier quoted context omitted.

You mean with the "two teams" that were tasked to develop the C / Rust versions? Yeah of course. Then again - they were one person teams, where the C "team" had years of experience in stm32 / embedded C / stm32 cube development and churned out that handwritten state machine in just days. The Rust "team" was a pre-masters intern with only minimal embedded Rust experience. They ran into all the pitfalls with (async) em…

That does not seem like even close to a fair comparison and makes me wonder how valid the conclusion is. Effectively this is two times n=1, if you use 'teams' when you actually mean 'individuals' then that's not really proper reporting. I do applaud you for having the same work done twice but it would have been far more meaningful to have two actual teams of seasoned developers do this sort of thing side-by-side. The…

I think there’s another hidden issue of testing how new devs use the language vs. those seasoned devs. I expect someone with a few months of experience would prefer Rust (fewer footguns) but someone with more experience would prefer C (the sharper knife). The flavour of the thing changes as we age.

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

#19
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]

The code won't magically stop running because the Rust community continued evolving the language. The old toolchains will be available if there's a compatibility change.

Where's the problem exactly?

Post reply on HN