HackerTrans
TopNewTrendsCommentsPastAskShowJobs

jamesmunns

no profile record

Submissions

Esp-hal 1.0.0 release announcement

developer.espressif.com
7 points·by jamesmunns·8 bulan yang lalu·0 comments

comments

jamesmunns
·16 hari yang lalu·discuss
My materials probably took 4-6 hours to write the first draft (I did most of it over two evenings, maybe one more just skimming the questions to figure out what things to talk about for each question), probably 2-3 hours or so to edit, then probably another hours over an evening just skimming it too many times before I hit submit. My materials were 16 pages or so, some of that was the original document (which has been linked in this comment section).

It's a fair bit of writing to ask for, but for a mostly remote and prose-driven company, you do a lot of long-form writing in the day to day work. The public RFDs and github issues/comments/commits give a good flavor for this.

As others have said, lots of my work is open source, and I have public writings and talks, so finding those were much easier for me than it might be for someone with only closed source works.
jamesmunns
·24 hari yang lalu·discuss
There's no single "embassy" crate, but all the components (HALs, executor, usb, net, etc.) are all on crates io and have been for a long time.
jamesmunns
·bulan lalu·discuss
It's worth noting that the support for ESP32 in Rust is official [0], and there are multiple full time engineers at Espressif working on developing and maintaining it.

[0]: https://github.com/esp-rs/esp-hal/
jamesmunns
·3 bulan yang lalu·discuss
It's really not so different! In embassy, DMA transfers and interrupts become things that you can .await on, the process is basically:

  * The software starts a transaction, or triggers some event (like putting data in the fifo)
  * The software task yields
  * When the "fifo empty" interrupt or "dma transfer done interrupt" occurs, it wakes the task to resume
  * the software task checks if it is done, and either reloads/restarts if there's more to do, or returns "done"
It's really not different than event driven state machines you would have written before, it's just "in-band" of the language now, and async/await gives you syntax to do it.

Even if you don't know Rust, I'd suggest poking around at some of the examples here:

https://github.com/embassy-rs/embassy/tree/main/examples

And if you want, look into the code behind it.
jamesmunns
·6 bulan yang lalu·discuss
Speaking as someone familiar with C and Rust (not so much Go!), although there's a parallel here to Rust's Traits, this actually is much closer to dyn Trait in Rust, which uses vtables and runtime polymorphism, rather than "regular" Traits in Rust, which are monomorphized versions of similar interface constraints, much closer to C++'s templates (or concepts, I'm hand waving here).

This isn't necessarily a negative, sometimes you actually prefer vtables and runtime polymorphism for various reasons like flexibility, or code size reasons. Just wanted to add some flavor for folks that aren't as familiar with Rust, that this isn't exactly how things usually work, as "regular" Trait usage is much more common than dyn Trait usage, which you have to explicitly opt-in to.
jamesmunns
·6 bulan yang lalu·discuss
As others have mentioned, ~all of the embassy HALs support nearly 1:1 parity of blocking interfaces for drivers next to the async ones. You really can avoid async entirely while still using embassy hals. The ecosystem is not tightly integrated/locked in.

Even data structure libraries, like embassy-sync, all have `try_` methods, which would allow for polling usage outside of async.

There's no mandate to use async - and helping folks that DO see value in it (which is a LOT of folks), isn't "splitting the ecosystem" - it's people doing things the way they like to do it. Embassy still works very hard to support folks who DON'T want to use async, to avoid duplicated work. There's nothing stopping you from preferring to write and maintain your own HALs, I know you have been for a while! But it's not something that people necessarily have to do, even if they aren't interested or don't prefer async!
jamesmunns
·10 bulan yang lalu·discuss
If you haven't seen it, Mara Bos' "Rust Atomics and Locks"[0] is an excellent book on this topic, even if you aren't particularly interested in Rust.

[0]: https://marabos.nl/atomics/