> One thing I am curious about is whether there is any plan for channels in Zig.
The Zig std.Io equivalent of Golang channels is std.Io.Queue[0]. You can do the equivalent of:
type T interface{}
fooChan := make(chan T)
barChan := make(chan T)
select {
case foo := <- fooChan:
// handle foo
case bar := <- barChan:
// handle bar
}
Obviously not quite as ergonomic, but the trade off of being able to use any IO runtime, and to do this style of concurrency without a runtime garbage collector is really interesting.
The Zig std.Io equivalent of Golang channels is std.Io.Queue[0]. You can do the equivalent of:
in Zig like: Obviously not quite as ergonomic, but the trade off of being able to use any IO runtime, and to do this style of concurrency without a runtime garbage collector is really interesting.[0] https://ziglang.org/documentation/master/std/#std.Io.Queue.