Cooperative concurrency

mu ships with deterministic, cooperative tasks and channels.

Tasks and channels

fn worker(out, n) {
  i := 1
  total := 0
  while i <= n {
    total = total + i
    i = i + 1
  }
  send(out, total)
}

ch := chan()
task(worker, ch, 10)
println(recv(ch))

Semantics

See docs/Specification.md for the full contract.

Next steps