5 ms·
I wish the state officially makes their income tax calculation available as machine-executable open-source software in an industry-standard language. For exampl
by nayuki 4y ago
I 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/).
- addcommitpush 4y agoOpenfisca started a bit earlier, in 2011.
- masklinn 4y agoYep, I fixed the timeline a bit after checking out the history page, as my original memories were incorrect. I guess because I'd first heard of openfisca around the time of the lawsuit.
- addcommitpush 4y agoIt is my understanding that before it became an Etalab project, it was quite obscure.
- nextaccountic 4y ago> 1. It would not, the tax law remains the spec. 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/ https://openfisca.org/en/packages/). This would be amazing!
- noughtme 4y ago> Indeed, code is probably a better medium for unambiguously communicating calculations. Ambiguity and obfuscation are usually intentional. Legislators and individual citizens do not necessarily have the same interests. This is why omnibus bills exist.
- astrange 4y agoLaws (in the US anyway) are "ambiguous" because they can't be changed very often, so implementing regulations are left to the executive branch, and the judicial branch can edit either one however they feel like anyway and aren't programmers.
- addcommitpush 4y agoThe French "income tax" (which, confusingly, is only one of the several taxes on income in France, and not the largest) is open source (https://gitlab.adullact.net/dgfip/ir-calcul https://gitlab.adullact.net/dgfip/ir-calcul). There's also the OpenFisca project (https://openfisca.org/en/ 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/ 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/ https://socio-fiscal.leximpact.an.fr/).
- andylynch 4y agoWhile this could help with the mechanical calculations and preparation of returns, the wider point about ‘verbosity and ambiguity of human language’ can’t be nearly so easily dealt with outside the simplest cases, and would likely make the tax code /harder/ for people concerned to interpret and reason about, which is probably the opposite of the desired result. 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.
- mytailorisrich 4y agoThat's why you should keep things as simple as possible and avoid exceptions and special cases, which legislators are experts at creating in tax codes. 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.
- MichaelZuo 4y agoHow would you encode trillions of possible permutations of special cases?
- BlueTemplar 4y agoWell, there's also that law which mandates that any algorithm used in an administrative decision must be explained in simple language upon request... but I am not certain that "administrative decisions" also covers the tax code ? (Though frankly, it should.)
- klabb3 4y ago> a machine-executable model would be unhelpful in determining whether Jaffa Cakes should be taxed for VAT as biscuits, or exempt as cakes. 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.
- nicbou 4y agoGermany kind of does. 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.
- deleted 4y ago[deleted]
- sohnakukkar 4y agoWhere one can find these diagrams?
- nicbou 4y agohttps://www.bmf-steuerrechner.de/interface/programmablauf.xhtml https://www.bmf-steuerrechner.de/interface/programmablauf.xh... It's a PDF that changes once in a while.
- krackers 4y agoIt would also allow people to re-use ML optimizers to get the highest tax returns!
- concordDance 4y agoDoes Excel count as open source and industry standard? Because if so, the UK has a giant tax spreadsheet you can put your data in and get tax owed: https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/1044764/2022-tcg.zip https://assets.publishing.service.gov.uk/government/uploads/... This document is the source of truth for tax calculations so it'll always give you the right answer.
- maelito 4y agoWhat a nightmare. Makes my i7 smoke with LibreOffice. Better than nothing though.
- gnad_sucks 4y agoToo good to be true.