There&#x27;s a lawyer at the MIT media lab named Dazza Greenwood who is working on projects along these lines. My understanding is that he&#x27;s already working with Boston to get any city ordinances that are amenable to the challenge to also be published with valid code of some sort. He has really worked through a lot of the issues and is really open about talking on the subject.<p>The formalization of all law into code fully is probably not fully achievable in the near term since there are many component parts of legal tests that are not really deterministically resolvable, and I think it would be a hard sell that justice is properly served if a call to rand() played a part in adjudication or sentencing.<p>I think a more profitable way to start integrating code is within the realm of contract law. A contract described in code has some advantages over even a well written legal prose contract: it&#x27;s testable, components could be more easily reusable, in some circumstances it could self-monitor for breach, it&#x27;s easily diffable. Such contracts could be made to be more transparent (assuming good faith and code-literacy) and less prone to purposely unenforcible clauses etc (law linter?). Some such contracts might be progressively abstracted into a genuine and good faith &quot;standard contract&quot; for [thing]. Of course now you need two lawyers who both can also program comfortably in the same programming language and I have to imagine the first judge to interpret such a contract is going to be pissed as hell (or more optimistically intrigued).<p>As far as starting from scratch all the time, we don&#x27;t really do that. The US legal system was basically just forked from England at first, and within the US we have a lot of model laws that are more or less universal (look at the <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Uniform_Law_Commission" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Uniform_Law_Commission</a>), but we do sometimes have some weird holdouts (pretty sure Louisiana still uses some Napoleonic code instead of UCC stuff).<p>Edit: sorry for the wall-o-text, also just thought of IoT&#x2F;semi-autonomous agents that might require the autonomy to decide whether or not to enter into a legally binding agreement on behalf of the operator without necessarily knowing ahead of time the counterparty or the exact terms. It would be a lot easier for these kind of bots if there were some generic contracting convention or DSL or something. I&#x27;m thinking trading bots and maybe of an intelligent shopping bot.