3 ms·
What are y'all's thoughts on Async in embedded? A portion of the Rust embedded OSS community really likes it as an abstraction over interrupts, critical section
by the__alchemist 5y ago
What are y'all's thoughts on Async in embedded? A portion of the Rust embedded OSS community really likes it as an abstraction over interrupts, critical sections etc. I've been burned by over-complexity and coloring problems with it before, eg in web programming.
Do you think it's a good fit? Use-case-dependent? Maybe for things like RF?
- steveklabnik 5y agoWe don't need it, so we don't use it. I think it's fantastic that it's possible, and I think that if you do need it, it's great to have it.
- floatboth 5y agoThere is an executor project: https://github.com/embassy-rs/embassy https://github.com/embassy-rs/embassy I'm very excited about this for one simple stupid reason: sleep(). Awaiting a timer delay deep inside some code is gonna be amazing. With typical sync code, you basically have to split your code and queue up the next work somewhere that would be picked up by the timer interrupt… basically doing the whole state-keeping that async would do for you.
- the__alchemist 5y agoThat sound like a nice advantage. I'd like to give this a shot on a future project. Its creator and I share some API design ideas, like using less typestate programming than other conventions, but I haven't used Embassy due to being cautious of Async. (The Typestate thing is a tangent; short explanation is it lets you check for misconfigured pins etc at compile time, but makes syntax significantly more verbose and harder to refactor)