News for hackers. Stuff that matters.
Re:Superfunctions: A universal solution against sync/async f... by nine_k on Thursday July 24, 2025 @06:35PM (#44677130)
But AFAICT in Zig you don't have to have async and sync versions. Instead, the runtime may choose to interpret `try` as an async or as a synchronous call, the latter is equivalent to a future / promise that resolves before the next statement [1]. This is a sane approach.

Having separate sync / async versions that look like the same function is a great way to introduce subtle bugs.

[1]: https://kristoff.it/blog/zig-new-async-io/

There are no comments on this comment yet.