5 ms·
A low level flight controller needs only statically allocated memory, so one of the main benefits of Rust is irrelevant. The syntax is still nice though.
by blt 8y ago
A low level flight controller needs only statically allocated memory, so one of the main benefits of Rust is irrelevant. The syntax is still nice though.
- StavrosK 8y agoAnd the much more stringent error checking, as I don't want a null pointer making my quad mow people down.
- bluejekyll 8y ago> so one of the main benefits of Rust is irrelevant Not sure what you mean with this comment. Even in a context like this, Rust has a lot of safety benefits, but yes you don't have access to the stdlib, and are restricted to core.
- perennate 8y agoI think parent meant "one of the main benefits" = safety not as useful because anyway no dynamic allocations are needed to implement a basic flight control algorithm.
- bluejekyll 8y agoIt also helps with other references, shared mutability, UB, etc. Allocation and deallocation focuses on small sliver of safety, but yes, That’s not a concern in that context.
- vvillena 8y agoThere was a comment in another thread that talked about the benefits of using the ownership mechanism to control access to all the I/O. It's possible that Rust is useful to manage not just memory, but all kinds of hardware resources.
- Matthias247 8y agoAs someone who has reviewed, debugged and fixed ton of issues in embedded code before, I strongly have to disagree. There are tons of memory issues that can also happen without dynamic allocations. Invalidated pointers to the stack are a prime example. Multithreading issues (on an RTOS) another one. And forgetting to release resources (e.g. a RTOS mutex lock) is yet another one.