Compilers, purity, and variance computation