This is great. I see immediate use in better Async/Await ergonomics. Zig was making rounds recently for their new async semantics [1], in which functions with an element of concurrency request a reference to a concurrent executor (the IO interface). The advantage is that you can drop the red/blue syntax. Plus, you can load your IO interface as a global const and reference it from anywhere without passing around a variable everywhere.
I see context variables as a step up from that. You can specify a dependency on some concurrent runtime environment (?async) and run with that.
stephenlf•5h ago
I see context variables as a step up from that. You can specify a dependency on some concurrent runtime environment (?async) and run with that.
[1] https://kristoff.it/blog/zig-new-async-io/