News for hackers. Stuff that matters.
Re:Zig: Upcoming Release Postponed Two More Weeks and Lacks ... by laserbeam on Wednesday July 19, 2023 @02:04PM (#36790628)
Yup. The lack of destructors means that at the time there wasn't an agreed upon way to cancel an awaitable function. Async/await in zig was cool, but there's a reason why it's described as an experimental feature in the article.
Re:Zig: Upcoming Release Postponed Two More Weeks and Lacks ... by kprotty on Wednesday July 19, 2023 @04:19PM (#36792599)
Destructors don't seem to be the best place to implement cancellation for async functions: Rust async is going through a phase where the community is realizing it would be nice to have async destructors or non-cancellable async functions to avoid introducing unnecessary overhead like concurrent reclamation, reference counting, and dynamically allocated memory for things that would otherwise be done statically using structured concurrency.