Coeffects: Context-Aware Programming Languages

3 dustingetz 1 8/1/2025, 12:14:55 PM tomasp.net ↗

Comments (1)

stephenlf · 2h ago
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.

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