this post was submitted on 25 Mar 2024
51 points (98.1% liked)

Rust

6011 readers
2 users here now

Welcome to the Rust community! This is a place to discuss about the Rust programming language.

Wormhole

[email protected]

Credits

  • The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)

founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 35 points 7 months ago (1 children)

Finally some positivity around async Rust!

I write a lot of embedded C for a living, and can't wait for the ecosystem to get better so I can switch to Rust. Threading always starts simple. All I need is to spawn a thread and wait for a message on a queue. Then requirements change and I'm waiting on multiple messages from multiple other threads and suddenly I'm writing yet another state machine that async Rust would write for me.

I also wish I had "coloured" functions in my embedded code. Often times it's not even documented if a function blocks or not, and sometimes the behaviour changes depending on compile time configuration (blocking, or interrupt driven, or DMA, etc.).

Async Rust certainly has it's complexity too, but at least to my brain it would make a lot of my code much simpler.

I need to find some time to really dig into Embassy one of these days.

[–] [email protected] 6 points 7 months ago (1 children)

I'm looking at Embassy too for a Pico project and combining it with a nostd mqtt implementation. However I need to understand Futures and if/how they relate to the async paradigm.

[–] [email protected] 4 points 7 months ago (1 children)

Sounds fun! I assume you're read the Async Book?

[–] [email protected] 4 points 7 months ago

I have not, but I will now thanks.