Also, this is essentially the underlying premise behind no-tolerance policies and three-strike drug laws with mandatory sentences, which view interpreting the law based on context as an impediment to enforcement, the solution for which is removing the ability of judges to do so. You can't have a just legal framework in which the only role of humans is to be punished or to exact punishment.
Basically, what you have to do is codify human discretion. If a judge wants to say "no, this really isn't a problem," he should be able to directly add that exception to the written law, and then enforce it as written. It's basically a kind of open source law. The question becomes of how to distribute authority.
So basically, more or less what happens now, only with more bureaucracy and complexity? I'm sorry, but I don't see the benefit in that case.
But if that line of reasoning were good enough, then the US made a mistake by rejecting the rule of a monarch. Democracy is rife with managerial issues.
But when your 'product' is violence on behalf of the state (in the anarcho-libertarian sense of 'violence' being any non-voluntary interaction with a person or power structure, sometimes involving actual violence) then the ability of humans to mediate, alter and affect that system becomes a feature as well as a bug. This necessarily limits the speed of the law and the degree to which it can be optimized, and remain humane, because removing humans from that system tends to merely concentrate power in the hands of the few humans necessary for it to function.
And then the questions become if humans can write the laws, and humans can update the laws, and humans are enforcing the laws, and have discretion in doing so, then what really is being automated, or optimized, other than recordkeeping? And for that matter, what does law as a programming language actually improve?
Other than record keeping? Why does it need to go beyond that? You don't want transparency in your laws? You don't want the ability to format and translate them as needed? You don't want the ability to do queries and comparisons? You don't want machines to be able to update their own behavior when the law changes?
I'm not talking about automating anything other than record keeping.
Such exceptions are sometimes codified in law, but the idea is that our legal system is based on trust rather than technical correctness. Not only do we defer judgement to a jury of our peers rather than rigid and uncompromising interpretation of the law, but we trust that all levels of government (judicial, executive, legislative) will act in our best interest rather than the letter of the law.
What you're proposing would require broad-sweeping revisions to all manner of law.