top | item 41459412

(no title)

Kostarrr | 1 year ago

It's really cool that google is investing so heavily in rust. However, the blog post is more of a "starting point" than a "lessons learned" (which I hoped for).

discuss

order

zamalek|1 year ago

I feel like it's a poor starting point, too. embedded-hal or embassy would be a much better starting point. Ultimately if you know enough to know what a memory mapped register is, you can _probably_ become dangerous with Rust really quickly. The alternative is someone using Arduino libraries, who would greatly benefit from a HAL of some kind.

What I found is that the Rust HALs are incredibly thin and understandable, I was digging into MCU datasheets within a month of first using embassy (with no prior embedded experience).

Analemma_|1 year ago

It's not a great title for the post, because it's ambiguous and could go either way, but the post itself doesn't pretend to be anything other than a how-to documentation guide for Android integrators.

nicce|1 year ago

In some sense it is bit missleading as well. On firmware level, you typically need to use a lot of unsafe code. Of course, this highlights the potential danger zones very well, if you use it correctly. But there is still chance that human made a mistake that leads into memory bug. It should be addressed, while it greatly reduces the risks.

timschmidt|1 year ago

I'm hacking on a firmware in Rust right now, for the ESP32-C3, and the only unsafe bits are buried deeply in the esp-hal crate for the C FFI to ESP-IDF and low level hardware twiddling. esp-hal exposes safe interfaces to all of that, so I've had to write zero unsafe code.

oll3|1 year ago

Yes, on hal level there will be a bunch of unsafe. On firmware application level it's not often I find the need to reach for unsafe though. It would typically be if the hal is lacking in some sense.