Government regulations… as software

Socialists accuse me of being a libertarian. Libertarians accuse me of being a socialist. I am actually a pragmatist: I believe that we should set things up to maximize our collective well being.

Government regulations are complicated. In Canada, our tax code is so complex that I doubt anyone ever fully knows it.

Regulators and law makers have often no experience building complex software. Yet what they often do is basically software programming. The difference is that, for now, the software runs on brains.

Laws are often buggy. Law makers can contradict themselves. For example, Chinese law gives the father the right to decide on whether his wife can have an abortion. Yet Chinese law also ensures that the mother is free to decide whether to have a child or not.

I think we should treat laws and regulations as software:

  • Laws and regulations should be considered in constant beta testing, just like Google’s software. We should accept up front that there are bugs, possibly major bugs.
  • There should be a cheap and transparent way to report bugs. Anyone should be able to report them and reports should be discussed publicly.
  • Laws and regulations should be systematically tested. For example, regulations could be introduced only locally, and at first only tentatively. You think you have a good idea to fight global warming? Try out your new regulations on a test basis and see whether it works. We should make it easy, not hard, to pull back a new law or regulation. We should assume that the first version of anything is buggy.
  • When a contradiction or other mistake is found, we should not just pretend that it does not exist. Instead, the law or the regulation should be patched. Anyone should be able to propose a patch. (You do realize that anyone can submit a patch to the Linux kernel right now?)
  • We should be able to trace back exactly who revised what and when. It should be trivial for anyone to browse the history of a regulation. Laws should be treated the same way: we should publish not only the law, but all its revisions with a detailed account of who proposed what.

Published by

Daniel Lemire

A computer science professor at the Université du Québec (TELUQ).

17 thoughts on “Government regulations… as software”

  1. This is a favorite topic of mine. To a large extent, all organizations are information processing systems, and hence an object of study in computer science.

    Writing laws is hard in the same way as writing AI for complex sandbox games such as Civilization. On the other hand, laws are small and simple, when compared to any nontrivial piece of software. Additionally, even the strictest and most pedantic person interpreting a law is likely to apply a great deal of common sense, so there no need to handle every borderline case and detail beforehand.

    Good law schools already teach logic, probability and game theory. Hence convincing the people writing and evaluating the laws to take a look at what they can learn from computer science should be entirely possible.

    On the other hand, people generally judge politicians by their intents instead of results, and for a good reason. Elections are held so often that there is rarely time to evaluate how a new law changed the society. And when the evaluation is finally done, it is rarely possible to say with confidence what caused a particular change in the society. Even more so, if the issue is at all controversial.

  2. Hi,

    I think that you are simplifying the problem too much when comparing software programming and government: Software runs on deterministic machines, laws don’t. Or even better, software tipically runs for a couple of architectures, while laws have to “run” on millions of architectures (each human being), and the worst part is that we don’t know the specifications of the architectures. So, making good laws is much more difficult than writing software, unless you don’t care about getting your head cut off.

    Personally, I’m more a pro-government guy (well, I don’t assume that regulations are bad or innefficient by default, at least no more than assuming that corporations are evil) but I agree with the core of all your proposals above. What I don’t like and can’t understand is that extreme simplification of the problem to support your beliefs. All the reasonament is basically a fallacy.

    Keep posting, though I have to say that I preferred you CS posts 🙂

  3. I wonder if a few decades from now we will have formal verification of legal documents. Does this new regulation contain any loopholes? This is a decision problem. Is there a decision procedure? If so, let the computer decide.

    This is wildly optimistic, of course. Nonetheless, legal expert systems is not a new field.

  4. As a slightly random side project, I started working on an idea a colleague had about putting state bills into a git repository, grabbing them from each stage. The advantage being that you’ve then got a clear indicator of changes that go along in the form of diffs.

    It been an interesting little exercise but lack of fine detail from state makes it hard.

  5. @Joan

    I’ll give you just one example. The war on drugs. What is the intent? To reduce the harm from dangerous drugs. What is the effect? Drugs are widely available, and lots of people end up in jail or otherwise harmed by criminality.

    Instead of just accepting the intent of the laws as reason enough, shouldn’t we be pragmatic and verify whether the laws do what they mean to do?

    Instead of judging intent, shouldn’t we measure effect?

    That is what software programmers do. Nobody cares what your software is meant to do. People want to do what the software actual does.

    I would argue that if your software runs on heterogeneous and unreliable hardware, it becomes more important, not less, to test, validate, patch, report bugs, and so on.

    Do not worry, I will go back to harder Computer Science later.

  6. Just to let you know, I’m a libertarian, and I consider you a libertarian. You might also be a pragmatist, but you are a libertarian.

  7. @Daniel Lemire

    I agree that the current regulation in most of the countries about drugs seems very few effective. In fact, I personally think that fighting against drugs is a waste of time. But that does not mean that they should be regulated, the same way medecines are regulated (any kind of consumer wants to know that whatever he or she is consuming has good quality).

    And, absolutely: we should evaluate laws more often, test, debug and patch them. But that does not mean that the solution is to remove the regulation, because that does not solve the problem either. I think that new technologies can help here to bring new tools to citizens to be more participative on this process of debugging/creating regulations.

    Finally, one big problem is that regulations sometimes have to be applied and watched by people who is against them, that also affects the effectiveness of the regulation, that you were mentioning (for instance: it is pretty usual, that when a Government changes, the new one un-does most of the changes of the previous one. And that is not productive at all).

  8. I only wished to point out that not all libertarians consider you a socialist, and I would guess that the ones that do are the type who would consider anyone that doesn’t tow the line on every issue to be a socialist. I would put you in a similar category as Tyler Cowen and Scott Sumner as a pragmatic libertarian. As a libertarian I don’t require you to label yourself as such 🙂

    With regard to your link, I agree that innovation is the key to growth. In fact Diedre McCloskey has written a few books about that, and she is about as libertarian as they come. If you have the time I’d recommend reading some of her recent books. Of course, I wouldn’t want you to reduce your frequency of posts on programming or mind hacks, or …

  9. @Joan

    But that does not mean that the solution is to remove the regulation (…)

    If a regulation does not make us better off, then we should remove it at once as it might have undesirable side-effects.

    one big problem is that regulations sometimes have to be applied and watched by people who are against them

    If a regulation is demonstrably beneficial, then it is much less likely that the regulators can get away without enforcing it.

  10. An interesting analysis. What I find even more difficult is the way laws get layered on top of one another. So, we have federal laws, state laws, city laws; and they do not always say the same thing. At the same time; the sheer number of laws means that with a high probability, we might be violating some law without knowing about it.
    John Stossel had an interesting programme on Fox News where he discussed how laws can suddenly make ordinary folks “felons”.
    Laws are like software: they are a set of rules that we must follow. The federal structure is somewhat like inheritance; and can often be buggy.
    I so wish we had a compiler for laws. At least that would check the first set of errors! 🙂

  11. I think a basic system engineering notion could help somewhat: negative feedback loops are essential to the stability of any system.

    What should be the first negative feedback loop in government? Accountability i.e. be accountable$ for your actions.

    One doesn’t need to go very far to understand that this notion is sidestepped regularly:

  12. I have no idea if it is actually feasible, but I like the idea of laws with expiration dates. The work of Congress would shift from passing new legislation to evaluating older legislation and determining if it is worth renewing. Now a bad law can be passed and exist indefinitely. It may be more likely to get rid of it, if it had to go up for debate and vote every X number of years.

  13. Nice post indeed. Software development analogy to developing regulations are quite interesting. From Austrian school, that markets’ are self-regulatory might not be that bad after all i.e. your Linux Kernel development analogy – ok Trovalds is regulating there – but still. The problem on self-regulation is not that Markets are able to regulate themselves (for finance), but there is an fundamental issue on the assumption that our actions do not affect the entire system. Which I think is wrong.

  14. @Joan: “Software runs on deterministic machines, laws don’t. ”

    This is not entirely true. Machines do not write software by-themselves, humans does. So developing large complex software with many contributors is like writing a law/bill.

Leave a Reply

Your email address will not be published. Required fields are marked *

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    Markdown is turned off in code blocks:
     [This is not a link](

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see