What is Nostr?
Dan Gohman /
npub1lv2…e8lq
2024-09-04 21:36:38

Dan Gohman on Nostr: Contrasting stream concepts: - streams as *channels*. First-class handles for the ...

Contrasting stream concepts:

- streams as *channels*. First-class handles for the read and write ends.

- streams as *coroutine creaters*. Functions with `stream` args or `stream` returns are like a coroutine consuming elements from the input streams and producing elements to the return streams.

Most of my experience is with channel style. In coroutine style, I sometimes think "what if someone passes you an output stream and then..." before remembering that that isn't a thing.
Author Public Key
npub1lv23llnug449h8k3ej9pz0edmeynjx7cl4p9h5r9q8uggm9qaw2s5xe8lq