zlacker

[return to "Avoid Async Rust at All Cost"]
1. cmrx64+b2[view] [source] 2024-01-23 11:53:39
>>jmakov+(OP)
I’ve recently (past year) been diving deep into async Rust and the modern Rust ecosystem after a several year hiatus (last active 2013-2016, pre-async). maybe this advice applies to a small category of application developers, but this take overall feels reactionary (versus constructive) and immature (cites OS primitives that don’t approach the same design space). There are pains with async Rust but the community should lean into trying to solve them. I personally don’t feel the pains as severely as described…

Deferred computation is a primitive, and threads do not solve it.

◧◩
2. bheadm+N6[view] [source] 2024-01-23 12:32:33
>>cmrx64+b2
I feel that, from a language theory level, it should be possible to implement functions that can be called in both sync and async contexts, removing the need for function coloring.

Any fundamentally blocking operations could be forced by the compiler to have have two implementations - sync (normal) and async, which defers to some abstract userspace scheduler that's part of the language itself.

◧◩◪
3. nijave+z7[view] [source] 2024-01-23 12:36:45
>>bheadm+N6
>it should be possible to implement functions that can be called in both sync and async contexts

You still have concurrency or interleaved execution to contend with but that could be represented more explicitly since it's not unique to async.

I haven't done much rust but implementing blocking operations as async functions is commonly achieved in Python by using threads under the hood anyway

[go to top]