RetroFed Forum
Your home away from modern life.
Zig's Io.Threaded is Neat
Post Reply
AuthorMessage
codeinabox programming.dev codeinabox@programming.dev
Joined: 2025-09-29
Quote

5   Original
ISO lemmy.zip ISO@lemmy.zip
Joined: 2025-06-06
#2 · Quote Reply

Buddy, there were trivial rust crates that both predated async rust, and are almost as old as Zig, that mostly if not fully provided what you're describing and more.

One non-notable example I used a very long time ago is pipeliner, the current implementation of which simply uses crossbeam channels behind the scenes.

That crate provides an extension trait to Iterator, and its .map() is unordered (there is an ordered option too), which means .map().next() returns on first completion, out-of-the-box, working with any iterator.


I feel like it's not rare for matklad's blogs to be weird like that. Like that time he compared synchronization methods, and concluded that rust's std Mutex was bad because another implementation was faster under high contention, not realizing that the other implementation used a back-off strategy in its locking which you could easily do with std Mutex::try_lock().

Who knows, maybe Andrew will call him a noob too one day 🙂.

1
Post Reply
Back to top