Comment by anonymoushn
Comment by anonymoushn a day ago
I think this design is a regression from the previous design, in which you could use compile time introspection to check whether things are actually async (calling convention) or not.
Additionally, I don't necessarily want to delegate the management of the memory backing the futures to an Io, or pass around a blob of syscalls and an associated runtime, which accesses everything via a vtable. I would prefer to have these things be compile time generic only.
Your preference to have them be compile time generic shouldn’t come at the cost of those that would want runtime virtualisation.
As the article concludes, you get the best of both worlds here, where the result is effectively compile time generic if you only use one io implementation in your program. In theory it’d also partially compile time generic if you exclusively use one io for one set of libraries/functions and a different io for another set of libraries/functions.
I see this as the objectively correct design based on the existing design decisions in Zig. It follows from the allocator interface decision.