These are called Reform Acts. They are indeed humungous tasks, rarely undertaken. Where I studied law, in the Northern Territory, a Law of Property Act was passed in 2000 and repealed Acts and overruled case law going back to the 12th century in Britain. It was indeed a massive effort.
For some areas of law the Act is also a Code (the Act explicitly says that it is the sole, whole body of the relevant law). This is mostly done for criminal law.
Codes are rare in common law jurisdictions like the US, UK, Australia, Canada, New Zealand etc. Codes are much more common in civil law countries like France, where the ideal is for all of law to be centralised and rationalised. Both systems require endless tinkering, debate and reinterpretation, which is why I am skeptical of universalist missions to convert the whole of the law into a system of formal symbols.
If I recall correctly Quebec separates by private and "public" law, so if you get divorced or break up a company it's one system, if you steal from someone, the other.
Somehow it's all hybridized and works.
Although arguably stating law in natural language might not help much with that either.
Legislation is typically drafted in a structured way, with deliberate norms and forms. There are professional drafters who do exactly that on behalf of legislators, and a body of case law on the interpretation of legislation that guides their work.
> As Merigoux explained more fully on his blog, this project became possible because the French government open-sourced the code that they use to calculate residents’ taxes, which was written in a domain-specific language called M, but they didn’t release the compiler that would have been needed to actually run any code written in that language. MLang is a compiler for M code written by Merigoux, and it has two special features: it translates the tax calculation function to Python, and it enables formal verification of features of the tax calculation using an automatic theorem prover called Z3.
Nevertheless, such efforts cover minimal portions already very clearly defined and debated. As another commenter replied, reforms are rarely undertaken for various reasons. One great issue with tax law is also that whatever code you may write is not necessarily guaranteed to be 'better' (fairness, revenue collected, lack of loopholes and edge cases, completeness, correctness... pick your metric) simply because it's code. That's what I thought too; but no longer.
I can only imagine that would be a humungous task. And presumably the existence of case law makes it much harder still.
It would be quite interesting to think about what the legal equivalent of unit tests would look like. Presumably a large collections of sets of circumstances and desired legal outcomes. It seems to me that this might be an interesting output of legislatures in addition to statutes (although whether they would/should be controlled by the legisalture or judiciary is also quite an interesting question, as our existing system seems to rely quite heavily on the judiciary being able reinterpret laws in ways the original legislators most likely didn't intend)