Live data from Hacker News

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

arxiv.org

21–30 of 172 posts

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

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

Are you implying Rust will stop working or something?

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

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

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

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

#23
post #16

Earlier quoted context omitted.

[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.

[flagged]

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

#24
post #20

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

If memory is a concern why are you trying to send JSON to a memory limited device?

The used protocol was part of the requirements, so the existing web service could be re-used.

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

#25

Earlier quoted context omitted.

"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

Maybe it wasn't written in Tex. The kerning does look a bit suspect.

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

#26
post #18

Earlier quoted context omitted.

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.

The problem with C - and I'm saying this as a life-long C programmer and not exactly a fan of Rust - is that C is indeed very sharp but it will cut other people just as easily even though they are far downstream of the original programmer, as well as the users of those programs. And it is extremely hard to not accidentally fall for one of the many pitfalls of C.

I've got my own set of restrictions for when I'm coding in C based on many nights spent poring over various pieces of code and trying to find a way to do it better and safer without outright switching languages. I do believe it is possible. But at the end of all that you have essentially redefined the language in a way that probably no other C programmer would like or agree with, and it would still require very good discipline.

So having languages with fewer footguns is good, as long as the lack of one kind of footgun isn't replaced by a other kinds of footguns. It is one of the reasons I'm interested in the FIL-C project.

https://fil-c.org/

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

#27
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'm curious what the concern is with the rust editions mechanics in place. Each crate gets to define the language edition it is compiled with. Even if dependencies up convert to later editions they can still be linked against by crates that are an older edition.

As for the broader crate ecosystem, if crates you depend on drop support for APIs you depend on, that could cause you to get stuck on older unsupported releases. Though that is no different of a problem than any other language.

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

#28
post #16

Earlier quoted context omitted.

[flagged]

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

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

#29
post #25

Earlier quoted context omitted.

nope, I was meaning the TeX source for the paper https://info.arxiv.org/help/faq/whytex.html

Maybe it wasn't written in Tex. The kerning does look a bit suspect.

Yup. Large companies have interesting rules sometimes.

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

#30
post #20

Earlier quoted context omitted.

If memory is a concern why are you trying to send JSON to a memory limited device?

The used protocol was part of the requirements, so the existing web service could be re-used.

Yeah, a common stupid requirement. Perhaps a selling point for any solution would be to deploy a common serialization/de-serialization package that can be used on both the cloud and end point side.
Post reply on HN