6 ms·
A Modern Compiler for the French Tax Code (2020)
- guerby 4y agoFrom the article: 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.
- secondcoming 4y agoThe system is the same in the UK, for people who have to do Self-Assessment.
- mytailorisrich 4y agoUK taxes are much simpler than French ones. 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.
- madeofpalk 4y ago> 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.
- tmnvdb 4y agoSame thing in the Netherlands, if you're a regularly employed person you usually just click 'next' a few times.
- ralfn 4y agoBut we didnt develop our own programming language to do this though.
- mjul 4y agoThe Dutch tax authority has developed RegelSpraak a controlled natural language for defining tax rules that is also formally specified and compilable to several targets. 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/MPS_DTO_Case_Study.pdf https://resources.jetbrains.com/storage/products/mps/docs/MP... Video: https://m.youtube.com/watch?v=_-XMjfz3RcU https://m.youtube.com/watch?v=_-XMjfz3RcU
- phh 4y agoNowadays, some people (like if they just have French salaries and no tax breaks) can even not look at it at all and their automatic filling will be automatically accepted
- nicbou 4y agoSame in Germany, although almost everybody is entitled to something. This must be why you get a default amount deducted for certain things. It must prevent labor-intensive tax declarations for very small refunds. 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.
- phh 4y agoRight, I don't really know how it is in other countries, but in France, the subsidies for poor people (that's obviously a shortcut and is more complicated) don't go through income tax but other systems. There is only one thing that applies to everyone which is work-related expanses (like the fuel cost to go to your work), but which has a 10% rebate if you don't declare anything, so you declare only if it's higher than that. I would guess maybe 20% of people can go through the fully automatic part, but I have no source for that.
- baud147258 4y agotoo bad the website is just a copy of the old paper forms in HTML form... Well at least I prefer using the website that to actually filling a paper form! (and being online make it easier to submit corrections if needed)
- guerby 4y agoThe FOIA request ("demande CADA") that led to publication of the French IRS ("DGFIP") software that computes taxes is here: https://cada.data.gouv.fr/20144578/ https://cada.data.gouv.fr/20144578/ Court ruling: https://www.april.org/files/20160216-jugement-tribunal-administratif-demande-communication-code-source-impots.pdf https://www.april.org/files/20160216-jugement-tribunal-admin... Some history: https://www.april.org/le-tribunal-administratif-valide-lavis-de-la-cada-les-codes-sources-sont-des-documents-administratif https://www.april.org/le-tribunal-administratif-valide-lavis...
- deleted 4y ago[deleted]
- nayuki 4y agoI wish the state officially makes their income tax calculation available as machine-executable open-source software in an industry-standard language. For example, a Python function that takes a dictionary of inputs (gross income, number of dependents, capital gains, etc.) and produces a dictionary of outputs (federal tax, state tax, rebates, contribution limits, etc.). 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-gst-hst-credit-calculation 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.
- el_nahual 4y agoI would accept just the test suite! For a given set of inputs here is your tax owed.
- masklinn 4y ago> This would solve many problems: The verbosity and ambiguity of human language (tax laws, tax calculation forms in English) 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/france-opens-source-code-tax-and-benefits-calculators-increase-transparency 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/ 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 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/ https://openfisca.org/en/packages/).
- 4y ago
- gandalfgeek 4y agoThe paper is fascinating from a compilers + VM perspective. Short video summary: https://youtu.be/ES7fkec3Jv8 https://youtu.be/ES7fkec3Jv8
- layer8 4y ago(2021)
- ZachWick 4y agoTwo of these authors are also two of the creators of the Catala programming language, which is "a domain-specific programming language designed for deriving correct-by-construction implementations from legislative texts." (https://catala-lang.org/en/ https://catala-lang.org/en/). Other publications in this area can be found at https://catala-lang.org/en/publications https://catala-lang.org/en/publications.
- ape4 4y agoWow the old version is only 92K lines of M code.
- gnad_sucks 4y agoIs the logic for such calculations known for the US? What about the UK?
- thechao 4y agoGiven that you know to apply a specific tax rule, the logic is formalized for the US. The problem is knowing when a specific tax rule applies to a given tax situation. In general, the IRS has an opinion — and not matching their opinion can land you in an audit — but the nuts-and-bolts application is still an interpretation. The IRS is, in my experience, pretty flexible with their interpretation. While individual auditors can have their hands tied with respect to fines/fee-schedules, I've always found them easy to work with, and knowledgeable. The last time I was audited, I ended up starting with a $220 fine; however, the auditor requested I review the previous several years of returns (for the same class of error), and I ended up getting a substantial check.
- maelito 4y agoAnother huge French "tax" set is the social contributions, that makes our payrolls quite complex. 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 : https://mon-entreprise.fr https://mon-entreprise.fr This is the source code of the underlying "tax" rules : https://github.com/betagouv/mon-entreprise/tree/master/modele-social/règles 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. https://publi.codes https://publi.codes
- peterisza 4y agoy no solidity
- LinkLink 4y agoThe year is 2030, after developing unrest the world government has decided the best way to subdue the population is to make taxes even more complicated. Entire family units are formed around starting on the years taxes 13 months before the next tax season, any attempt to simplify tax is killed by the turbotax lobbyists, who boast a legendary 11 month taxes turnaround. Paper supply is at an all time low due to economic returns, and most crime is centered around illegal paper trade in order to file a paper return, and avoid the automatic audit on any virtual returns submitted.
- parentheses 4y ago> which unlike French wine, did not age well with time. :chefkiss:
- Dowwie 4y agoThe old implementation didn't age well, but a newly invented language that 2 people understand will age much better.