zlacker

Avoid Async Rust at All Cost

submitted by jmakov+(OP) on 2024-01-23 11:34:51 | 46 points 62 comments
[view article] [source] [go to bottom]

NOTE: showing posts with links only show all posts
◧◩◪
15. jamesm+W9[view] [source] [discussion] 2024-01-23 12:51:39
>>bheadm+67
This post discusses the issues:

https://blog.djha.skin/blog/the-down-sides-of-gos-goroutines...

From this recent discussion:

>>38821840

It's not to say that Go is bad in this regard! It is just (always) doing the heavy lifting for you of abstracting over different colors of functions. This may have some performance or compatibility (especially wrt FFI) concerns.

Rust chose not to do this, which approach is "right" is subjective and will likely be argued elsewhere in this thread.

◧◩◪
30. bryanl+sd[view] [source] [discussion] 2024-01-23 13:16:09
>>zaphar+Ya
It looks like there's good movement on the proposal to bring pollster[1] or similar into the Rust standard library.

I think that's awesome. They've been afraid to "bless" an executor for good reasons, but pollster has 0 chance of "winning" even if blessed since it lacks so many features. However it's a solution to the problem you expressed: I/O crates can be async and used with pollster in sync contexts.

1: https://docs.rs/pollster/latest/pollster/

31. Cianti+Bd[view] [source] 2024-01-23 13:17:37
>>jmakov+(OP)
Async solves different problems, you can, for instance, have just a single-threaded CPU and still have a nice API if you have async-await. It might not be so cool at a higher level as Go's approach of channels and threads, but it's cool in embedded, read this:

https://github.com/embassy-rs/embassy?tab=readme-ov-file#rus...

"Rust's async/await allows for unprecedently easy and efficient multitasking in embedded systems. Tasks get transformed at compile time into state machines that get run cooperatively. It requires no dynamic memory allocation, and runs on a single stack, so no per-task stack size tuning is required. It obsoletes the need for a traditional RTOS with kernel context switching, and is faster and smaller than one!"

I'm just toying with Raspberry Pi Pico and it's pretty nice.

Go and Rust have different use cases, the async-await is nice at a low level.

49. zzleep+BM[view] [source] 2024-01-23 15:59:19
>>jmakov+(OP)
> The purpose of flagging is to indicate that a story does not belong on HN. Frivolous flagging—e.g. flagging a story that's clearly on-topic by the site guidelines just because one personally dislikes it—eventually gets an account's flagging privileges taken away. But there's a new 'hide' link for people to click if they'd just like not to see a story.

>>12173836

This story seems to very much belong on HN. Just because the statement is opinionated and some users don't like it, it doesn't mean that we can't debate about its merits.

◧◩◪◨⬒
60. bryanl+s65[view] [source] [discussion] 2024-01-24 19:37:51
>>Aissen+Vm4
Good question. I might have been projecting my hopes to make it sound more formal, but the only thing I could find following my cookie crumbs was the mention in https://without.boats/blog/why-async-rust/
[go to top]