If a compiler could proof that creating the channels&#x2F;go routines&#x2F;what-have-you does not influence the arithmetics (e.g. because only associative operations are used and the order doesn&#x27;t matter), it could constant-fold the loops and just output 499999500000 directly.<p>I don&#x27;t know any compiler (and language implementation) that can do that, though.