Live data from Hacker News

Rust for Embedded Systems: Current state, challenges and open problems

arxiv.org

101–110 of 159 posts

Re: Rust for Embedded Systems: Current state, challenges and open problems

#101

Earlier quoted context omitted.

>the people comfortable with the language are all the ones that don't know about the problems. Or the ones writing code where security doesn't matter, like HFT and video games (the former have no users, and the latter are basically impossible to make crack-resistant even if they're written entirely in Rust).

It's not only security, it's correctness. It's about your software staying running and doing the right thing. I can believe HFT developers think they don't need it.

First, 100% of HFT are businesses trying to make money above all else. Security and correctness are secondary to the business requirement of making money, especially when you are uniquely situated to have financially quantified their risk when things go wrong to remain within controlled error bands.

Second, HFT developers are using very expensive FGPAs to do trading with network packets. People are quick to reach to some example where their favorite toy is used at some organization, but that's besides the point. The tools for getting code on those FPGAs is horrible and unless Xilinx adopts Rust internally I doubt much will change. Rust can be adopted elsewhere, but that's not what's making the organization money. HFT folks are not persuaded even slightly by these arguments about security and correctness. Jane Street is not a HFT firm and they will gladly tell you that.

It helps immensely to understand ones concerns, constraints, and values before assuming they're identical and them swiftly demonizing anyone that dissents. The Rust community really has done itself a massive disservice in alienating everyone that doesn't conform to its monoculture composed mostly of amateurs and unemployable extremists.

Of course, this will simply be downvoted by the pathetic and unimpressive. Nobody views this as an opportunity to even try disputing the argument or use it as a legitimate data point that Rust should strive for. They simply want obedience and mindlessness in the monoculture because they lack the tools needed to handle conflict of any kind. It's also why so many features are perpetually stuck as nightly rather than stable. The project does nothing but stultify talent into leaving for genuine innovation.

Re: Rust for Embedded Systems: Current state, challenges and open problems

#102
post #68

These are all real issues with Rust, though it's worth noting that many of the integration challenges mentioned also apply to external code written in C and C++. Some of the survey responses highlight one of the biggest hurdles to rust adoption I've experienced though: Rust has an education problem. People dramatically overestimate the correctness of their [C/C++] code and underestimate the potential severity of fail…

> People dramatically overestimate the correctness of their [C/C++] code Genuinely interested: what do people think of their tons of third-party dependencies in Rust? My experience building Rust projects is that there are orders of magnitudes more dependencies than what would make me comfortable. At least in C/C++ it's much harder to get there.

In C/C++ every project ends up with a hand coded replacement for those external dependencies that is less well written and infinitely less tested.

Re: Rust for Embedded Systems: Current state, challenges and open problems

#103
post #92

Earlier quoted context omitted.

Long story short is that I trust their quality. The community is great about vetting unnecessary uses of unsafe code. That’s more than can be said about hand rolled equivalents in C/C++.

So if you have 200 dependencies, you trust them just because they don't run what Rust calls "unsafe" code? What about safe code that could be malware?

FYI Google and Mozilla audit all their dependencies and share them:

* https://chromium.googlesource.com/chromiumos/third_party/rus...

* https://searchfox.org/mozilla-central/source/supply-chain/au...

It's quite likely that most of your dependencies were already audited.

Re: Rust for Embedded Systems: Current state, challenges and open problems

#104

Earlier quoted context omitted.

That seems completely reasonable. The only interesting case is "There was far too little storage, so we gave up early" e.g. you need 14GB, there is 186MB available, give up. I probably don't want my photo viewer to crash because I tried to open a JPEG that wouldn't fit in RAM, better it just says that's too big and I can pick a different file. Whenever people are imagining they're going to recover despite OOM in low…

Postgres is designed to recover on OOM in most cases.

That's nice, how well does it work in practice?

Re: Rust for Embedded Systems: Current state, challenges and open problems

#105
post #33
post #23

As a rust programmer that programs C++ on embedded, the main thing preventing adoption is the ecosystem. So let's say I happen to work with a MCU that is well supported in Rust, what if I want to connect it to a popular OLED display? Is there a library for that? If so, does it work? If it works, does it have the needed features? Now maybe I am incredibly lucky and all of that works, what about a popular gyro IC? Gran…

> As a rust programmer that programs C++ on embedded, the main thing preventing adoption is the ecosystem. Maybe the mindset of the industry as well? Not sure if things have changed (and if so, how) but 9-10 years ago when i was in university I had an interview with a company that did embedded systems stuff. While talking about my competencies I mentioned I was able to create cross-toolchain if they were interested a…

Ah yes, then the vendor goes out of business and they have to bring in highly paid consultants to fix bugs in the vendors' gcc 2.95/Linux 2.6.x port to their SoC.

You need to be in the right kind of company - the one where waiting for the external vendor to fix their shit is too slow.

Re: Rust for Embedded Systems: Current state, challenges and open problems

#106
post #99
post #50

Earlier quoted context omitted.

>To be fair, these problems are not inherent to Rust--any language which tries to interface with C will have them. Yes, including C.

Incorrect. Two C libraries interface just fine if library 1 handles ownership and library 2 (or your program) simply operates on the resulting things being passed around. Rust, on the other hand, will go bananas and your life will be miserable. See: http://way-cooler.org/blog/2019/04/29/rewriting-way-cooler-i...

That 2019 blog post explains how, having made a whole series of mistakes, they're now going to rewrite everything in C and it'll go much better. The next blog post says they've abandoned the project instead.

To me, it seems like they'd lost motivation years previously and were increasingly flailing around for something that would spark the same joy as initial work on an exciting new project, and Rust has little to do with that.

Lots of crates exist which wrap popular C libraries, and they don't seem to run into the sort of misery you describe.

Re: Rust for Embedded Systems: Current state, challenges and open problems

#107

Earlier quoted context omitted.

> People dramatically overestimate the correctness of their [C/C++] code and underestimate the potential severity of failures to meet that expectation Really depends on the field. I heard more than once in my life now that it's better to reboot every night than spend even an afternoon of engineering trying to fix memory leaks.

MongoDB's BSON library calls abort() on malloc failure because they can't be bothered to handle OOM gracefully.

What else would you expect them to do?

Re: Rust for Embedded Systems: Current state, challenges and open problems

#109
post #92

Earlier quoted context omitted.

So if you have 200 dependencies, you trust them just because they don't run what Rust calls "unsafe" code? What about safe code that could be malware?

FYI Google and Mozilla audit all their dependencies and share them: * https://chromium.googlesource.com/chromiumos/third_party/rus... * https://searchfox.org/mozilla-central/source/supply-chain/au... It's quite likely that most of your dependencies were already audited.

So what in there guarantees I can get the same thing they audited?

Re: Rust for Embedded Systems: Current state, challenges and open problems

#110
post #68

Earlier quoted context omitted.

> People dramatically overestimate the correctness of their [C/C++] code Genuinely interested: what do people think of their tons of third-party dependencies in Rust? My experience building Rust projects is that there are orders of magnitudes more dependencies than what would make me comfortable. At least in C/C++ it's much harder to get there.

In C/C++ every project ends up with a hand coded replacement for those external dependencies that is less well written and infinitely less tested.

What about all of the projects where your assumptions are false?
Post reply on HN