That one issue alone is a perfect example of why law is complex and experts in law are needed. Morals are subjective. Countries are large.
Edit: 2018, so not a few months ago
Not sure if any suggested changes got incorporated or even addressed, but it's a really interesting concept
There could be some sort of VM (state machine?) which executes these laws (programs). A queue accepts change requests from the edges, e.g. citizen1 wants to sell her car to citizen2 would generate a change request. The queue processor validates the change request, finds the appropriate reducer (= law) for it, applies the reducer to current world state + change request and derive the new world state.
The programs (laws) themselves could also be objects of the world state. Changing the law is then another change request (self-modifying code).
One big issue with this is that the reducers should probably also work at the edges. Paying with a credit card in a shop should work even if the Internet is down. Diverging state histories should be the norm not an exception. We should figure out how to ensure we can always resolve the merge conflicts.
To take this example I found off the NYS assembly website legalizing adultery (it was the first one I found, I swear)
https://nyassembly.gov/leg/?default_fld=&leg_video=&bn=A0010...
It's phrased as "Section 255.17 of the penal law is REPEALED", but if you try to find "the penal law", but if you look up a a copy of the penal code do you see 255.17 in it? If so, how can you find out what was actually repealed. If not, do you need to hunt through every possible amendment to figure out the state of the law is at the time of reading?
"New laws" have to quite literally be diffs of the existing law.