What is Nostr?
Hailey /
npub1hfp…mxty
2024-02-11 00:13:56

Hailey on Nostr: I strongly feel that the maybe-async/keyword-generics stuff being worked on in rust ...

I strongly feel that the maybe-async/keyword-generics stuff being worked on in rust at the moment is a bad idea.

If your code might be async, just write it as async! Writing async code doesn't tie you into using an async runtime - all it means is that the compiler generates a state machine for you. You can totally slot in some blocking calls, never return Poll::Pending, and your async function will complete on first poll.

The side benefit to this is there's no weird bifurcated API: your code, whether blocking or non-blocking, is always compiled as a state machine and can be treated just the same.
Author Public Key
npub1hfp4cwr2fdpd2mfztcmx99ua0yzv9nvsw9g09y7sek9xqxgjr7qqftmxty