zlacker

[parent] [thread] 1 comments
1. thiht+(OP)[view] [source] 2024-01-20 09:59:35
Interesting thinking, thanks for the details! I’ll have to look into Zig’s async mode, it seems pretty good but I’m wondering what are the drawbacks of this approach (and specifically, why would you ever set io_mode to "sync")
replies(1): >>anonym+Vo2
2. anonym+Vo2[view] [source] 2024-01-21 03:37:27
>>thiht+(OP)
This post is a bit confused. io_mode is an stdlib feature that changes some blocking stuff in the stdlib to use the stdlib's event loop. There's not such a thing for most libraries.

For typical libraries, functions and structs are provided, and to the extent that these functions call functions provided by the user, they are generic over the async-ness of those functions. That's how the language-level async feature works, for library code that doesn't specify that it is async and doesn't specify that it would like to use a specific non-async calling convention for calling the user's callbacks.

[go to top]