This is a drum that, like privacy and encryption, we techies need to start banging hard before it's too late. The fact that laws are fundamentally limited by our abilities to enforce them, and that laws are fundamentally written to be enforced by humans with some discretion, is such a deep assumption for us that we don't see it. We irrationally tend to conceive of a law that says "It is a felony to wear your hair in a ponytail on a Tuesday" as an absolute, even though what it really means is "If a police officer spots you with your hair in a ponytail on a Tuesday, and by their discretion arrests you, and at the discretion of a prosecutor charges you, who at the discretion of a judge and jury convicts you, you will be guilty of a felony." All laws actually say that, but that's not how we humans speak or conceptualize them. Also note the importance of a human even spotting the violation in the first place.
So, naturally, when we get technology that can rigidly enforce law, we don't program them with the "real" law, we program them with the text of the law. But the truth is, the text was never passed as a law. When the law was deliberated, everybody was really deliberating the version that involves all the human discretion, and prior to the introduction of computers, the law that was really enforced was the one with all the human discretion. A rigidly-enforced-by-computer law is a fundamentally different law, in the most concrete way possible; actions that you would never have been penalized by the human law result in immediate penalty in the computer world. There's no more concrete way to prove the point that it is a fundamentally different law.
We CAN NOT simply translate the text of the law into computer programs. If we are going to do computer enforcement of laws (and I'm going to drop the question of whether that's a good idea, feel free to debate in replies), we must write new law. By that, I do not merely mean that society has an obligation to write new laws, but that the very act of programming a law is writing a new law into existence, one never deliberated by the processes of democracy. We literally can not simply translate laws into programs. It is impossible. The result is not the same law.