logoalt Hacker News

bschwindHNtoday at 7:06 AM0 repliesview on HN

I can agree to an extent that API designers sometimes (often?) over engineer for imagined problems.

At the same time, I've been working on an embedded Rust project and trying Embassy for the first time and it is _amazing_.

First of all I've had good logging and debug support with probe-rs. Secondly, being able to do ergonomic DMA transfers with async/await syntax feels like cheating. The core goes to sleep until your transfer finishes and an interrupt fires which wakes up the core and continues your async state machine, which the compiler built for you from your async code.

Distinct tasks can be split up into separate async functions, the type system models ownership of singleton hardware well (you can't use Pin 8 for your SPI bus there, you already "moved" it to your I2S peripheral over there!), and it all comes together with pretty minimal RAM usage, efficient use of the hardware, and low power consumption if you're mostly waiting on data transfers.

I'd be happy to talk more about practical problems if you want to get specific.