Compiling distributed system specifications into implementations