News for hackers. Stuff that matters.
Re:Should you Rust in embedded yet? by Analemma_ on Wednesday February 28, 2018 @09:36PM (#16489227)
I’m not an embedded developer, but my guess is that if they’re not even using dynamic memory, I doubt they need or want anything that C++ has to offer.
Re:Should you Rust in embedded yet? by jwhite on Wednesday February 28, 2018 @09:56PM (#16489320)
That's more a matter of experience and attitude -- even simple things like reference types are nice. Also, templates offer a lot of abstraction power that can be used to model the hardware nicely, without sacrificing efficiency.

Many embedded programmers come from a background that doesn't expose them to those sorts of ideas though.

Re:Should you Rust in embedded yet? by carlmr on Thursday March 01, 2018 @03:18AM (#16490431)
Can confirm, C++ has some nice features which I'd even like without malloc. OTOH I'm already horrified at the code quality problems pretty much every embedded shop faces. C++ would only make this matter worse.

As a software inclined embedded guy I also often think of what would be possible if we switched to C++. But then I think of what's probable.

Re:Should you Rust in embedded yet? by Matthias247 on Wednesday February 28, 2018 @10:36PM (#16489471)
Even without dynamic memory there's ton of useful things:

Namespaces, References, collection types (std::array, string_view, intrusive containers, etc.), RAII (release mutexes at scope ends), strong typing, proper encapsulation, interfaces, etc.

Re:Should you Rust in embedded yet? by Symmetry on Thursday March 01, 2018 @09:53AM (#16492443)
In general tools for constraining hardware complexity like namespaces and encapsulation are a lot less important for the project sizes where you're typically working with embedded systems. For the rest they mostly provide some benefit but that's offset by the danger of a move to a much, much larger and more complicated language in an environment where many people writing code are primarily EEs and most C++ answers they Google will provide solutions inappropriate for embedded development. And I say this as someone who was one of those EEs when he started out.
Re:Should you Rust in embedded yet? by monocasa on Wednesday February 28, 2018 @10:20PM (#16489418)
RAII is absolutely killer. Managing real time priorities with lock_guards so that you can never forget to drop priority will win over almost any grizzly old firmware engineer.
Re:Should you Rust in embedded yet? by tarmon on Wednesday February 28, 2018 @09:53PM (#16489299)
There is still a lot to be gained by strong typing even in projects where everything is statically allocated.
Re:Should you Rust in embedded yet? by bb88 on Wednesday February 28, 2018 @10:12PM (#16489391)
Many people need in memory databases and linked lists (or binary trees) to hash information and sort it.

There's a case to be made for an OO style program where I create an object and give it a chunk of memory to manage a B-tree, so I can keep my memory from being fragmented, but using C++ for that is serious overkill.

Re:Should you Rust in embedded yet? by pknopf on Wednesday February 28, 2018 @09:44PM (#16489265)
I can see people arguing for object oriented over procedural.

As I type that, I realize I've recently learned to love Go, so maybe it is my bias.