A Modern Compiler for the French Tax Code (2020)
arxiv.org
arxiv.org
This would solve many problems: The verbosity and ambiguity of human language (tax laws, tax calculation forms in English), the ability to inspect and independently verify calculations done by the state, the rent-seeking tax preparation software companies.
Here is my own feeble demonstration of the idea: https://www.nayuki.io/page/a-math-programming-view-of-canada...
Even if the state has its own online portal for you to review and adjust your tax return, I still want to see the full tax code be open source and runnable by the user.
1. It would not, the tax law remains the spec.
2. France does provide an executable encoding of the tax code, TFA is literally a compiler for that.
3. France started to do so circa 2016 (https://joinup.ec.europa.eu/collection/egovernment/document/...) after losing a FOIA-type case, though feelers had already been sent as a governmental agency (CAS) is at the root of OpenFisca (https://openfisca.org/), and by then the prime minister's data sharing and coordination office (etalab) had started using and contributing to it (https://openfisca.org/doc/manifest-history.html)
4. You can use OpenFisca to encode your own country's tax law, or lobby for your country to encode its tax law there (https://openfisca.org/en/packages/).
Unless you rewrite the law to make the code the spec. Indeed, code is probably a better medium for unambiguously communicating calculations.
> 2. France does provide an executable encoding of the tax code, TFA is literally a compiler for that.
But other countries might not do so.
> 4. You can use OpenFisca to encode your own country's tax law, or lobby for your country to encode its tax law there (https://openfisca.org/en/packages/).
This would be amazing!
Ambiguity and obfuscation are usually intentional. Legislators and individual citizens do not necessarily have the same interests. This is why omnibus bills exist.
And they are updated quite frequently and implemented quite programmatically!
But the laws also remain ambiguous because the world is an ambiguous place with a lot of edge and corner cases with unforeseen knock on effects.
That said, one would hope
1) the tax code would be one of the least open-to-creative-interpretation parts of the system
2) the IRS equivalent could actually produce this code, rather than legislators
There's also the OpenFisca project (https://openfisca.org/en/) which is a Python framework for coding tax and benefit system - France being the most complete - which is used in many things, like a web app to see which benefits you might be eligible to (https://www.mesdroitssociaux.gouv.fr/accueil/) or the French National Assembly tool to compute the effects of changing tax law (https://socio-fiscal.leximpact.an.fr/).
Firstly the actual text of the law must be as legislated.
Secondly, law and most certainly tax law is necessarily nuanced in interpretation and the consequences for taxpayers and the government are material (to use a relatively simple and well-known British case, a machine-executable model would be unhelpful in determining whether Jaffa Cakes should be taxed for VAT as biscuits, or exempt as cakes. Then ask about chocolate chip cookies (zero rated) vs chocolate digestives (taxed!)). Stuff like this and more is argued about all the time.
In your example this is because someone argued that staple food should not be taxed. Right, what is staple food? Obviously they decided that biscuits were but not cake. Pandora box is opened as soon as you allow any special cases.
You can have these definitions remain vague and still have an algorithm that is well defined over pre-labeled data. The purely mechanical steps based on arithmetic could (and should!) be defined as machine-parseable code or formulas.
They publish all the diagrams for income tax calculation, if you can decipher them. It takes a while but you get it right eventually.
This is how I built my income tax calculator and keep it updated.
It's a PDF that changes once in a while.
This document is the source of truth for tax calculations so it'll always give you the right answer.
Better than nothing though.
Other publications in this area can be found at https://catala-lang.org/en/publications.
https://cada.data.gouv.fr/20144578/
Court ruling:
https://www.april.org/files/20160216-jugement-tribunal-admin...
Some history:
https://www.april.org/le-tribunal-administratif-valide-lavis...
Computing payrolls is handled by the private sector, contrary to the case of the income tax.
But the French administration develops an open source set of online simulators :
This is the source code of the underlying "tax" rules :
https://github.com/betagouv/mon-entreprise/tree/master/model...
Is uses an open source specific language that frames the writing of simple calculation rules, auto-generates an online documentation for non-developers and helps developers build automatic UIs.
It is unfortunately not yet translated for English speakers and developers.
Short video summary: https://youtu.be/ES7fkec3Jv8
Unlike, say, the United States, the French system relies heavily on automation. During tax season, French taxpayers log in to the online tax portal, which is managed by the state. There, taxpayers are presented with online forms, generally pre-filled. If applicable, taxpayers can adjust the forms, e.g. by entering extra deductions or credits. Once the taxpayer is satisfied with the contents of the online form, they send in their return. Behind the scenes, the IR algorithm is run, and taking as input the contents of the forms, returns the final amount of tax owed. The taxpayer is then presented with the result at tax-collection time.
In France everything is complicated with a huge number of taxes and rules.
In the UK, if you are employed you don't have to do anything. Income tax and National Insurance are calculated and taken at source automatically. Your other tax is the local Council tax, which is also simple and can be paid automatically.
Helpfully my local council resets your enrollment or automatic payments each year, leading one to forget about them until you get a big nasty letter in the mail.
There is a video of the team presenting how they built the DSL for tax rules in the JetBrains MPS language workbench from the MPS conference.
Case study:
https://resources.jetbrains.com/storage/products/mps/docs/MP...
Video:
I built a tax calculator for English speakers, and highlighting that is next on my todo list. Many people pass up on significant returns, especially parents.
I would guess maybe 20% of people can go through the fully automatic part, but I have no source for that.