Live data from Hacker News

A Modern Compiler for the French Tax Code

arxiv.org

71–80 of 136 posts

Re: A Modern Compiler for the French Tax Code

#71

Earlier quoted context omitted.

Australian CSIRO is working exactly on that https://theconversation.com/csiro-wants-our-laws-turned-into... https://research.csiro.au/bpli/our-research/reasoning/ https://people.csiro.au/G/G/Guido-Governatori They are using https://en.wikipedia.org/wiki/Deontic_logic and https://en.wikipedia.org/wiki/Defeasible_logic describe laws in terms closest to how it's done in the legal community. Can't find a link but they co…

https://theconversation.com/csiro-wants-our-laws-turned-into... claims law-as-code is a bad idea because its "dynamic"/"always changing" and "discretionary"/"requires or open to interpretation". The first argument is nonsensical (computers are great at changing data: in fact way faster and more accurate than humans, having the capacity for things like single source of truth, change logs, peer consensus, and dynamic v…

> The second argument is an outright straw man fallacy. Who cares if some laws require interpretation. Just write MAY instead of WILL (like RFC language) to make it clear the judge can decide, then provide statistical information regarding past case law. Nobody is saying "fire all the judges", they're just saying make the law clear. Right now it's not clear, and it's a big problem.

But that is not how law works. A judge is generally expected to interpret the law because we cannot expect someone who wrote the law to have predicted all possible things, especially those that did not even exist when the law was written.

It's (often) not close to a machine-interpretable spec, but a to visual mockup, to stay in the software area.

For example, you may have a law to forbids euthanasia. Does it also extend to assisted suicide? What if the dying person can't physically trigger their own death? What if assisted dying is illegal here, but someone takes the patient to the neighboring country?

Also, I hardly believe "read up to date law in your language" is possible, there are entire legal concepts that do not exist in different jurisdictions, or literally the same expression may mean different things ("voir dire" for example).

It's good to attempt formalizing things, but I don't think this is a strawman.

Re: A Modern Compiler for the French Tax Code

#72

I've been asked to write parser of _my_country_law_ and something that's capable of doing diffs and putting it together (diff+original=>newest version) docs without knowledge in that domain after seeing sample doc I've estimated it on something like 1 week of work (XD) month later I've been crying and having like 20-30% done this shit has been so sensitive (insanely error prone) and debugging was time costly. I think…

Do you plan on open-sourcing it, or do you have any recommendations for similar projects/research? Very excited about the computational law space.

Re: A Modern Compiler for the French Tax Code

#73
post #63

During one of those rabbit hole journeys I discovered that Dutch Tax authorities use MPS, a DSL creation language/tool by JetBrains [1] It makes me wonder, why haven't DSLs caught up? Their claim that it allows developers spend more time implementing the business logic makes sense. But somehow that promise hasn't been realised. I'm curious to know from those who tried DSLs. [1] https://www.jetbrains.com/mps/documenta…

I make them all the time ( https://jtree.treenotation.org/designer/ ), and track many thousands of DSLs. IMO, the problem is our languages are unnecessarily complicated. they are all linearly parsed BNFs, and you don't need any of that. I think things will start changing big time. That being said, my favorite ecosystem in the traditional DSL world is ANTLR, and I'd highly recommend Terence Parr's books on the field i…

Does his book actually teach you how to create a DSL using ANTLR and not just and overview? Btw the 2 books of his are almost a decade old, so are they any good now?

Re: A Modern Compiler for the French Tax Code

#74
post #19

Earlier quoted context omitted.

My entire industry (subset of healthcare) mostly uses a single application for 95% of our core business functions. That application is written in Visual FoxPro and is, predictably, pretty terrible. Obviously it isn't going to get better, either, but it'll be a decade or more before there's a serious competitor.

I'm not near the space any longer (in a former life, the healthcare industry was a big customer of our computer systems). But a significant portion of healthcare in the US used to use a proprietary language called MUMPS. https://en.wikipedia.org/wiki/MUMPS

MUMPS is quite popular in finance, mostly through Cache product.

Including for new developments.

Re: A Modern Compiler for the French Tax Code

#75

I've been asked to write parser of _my_country_law_ and something that's capable of doing diffs and putting it together (diff+original=>newest version) docs without knowledge in that domain after seeing sample doc I've estimated it on something like 1 week of work (XD) month later I've been crying and having like 20-30% done this shit has been so sensitive (insanely error prone) and debugging was time costly. I think…

Who was the client?

I ask because my state's legislature has a staff that reviews proposed legislation and then maintains the revised official laws. If I was tasked with doing diffs, I'd first interview them, try to make their jobs easier.

Re: A Modern Compiler for the French Tax Code

#76
post #5

Here's the source code of the implementation of the tax code: https://github.com/etalab/calculette-impots-m-source-code

Hi, one of the paper authors here. This is unfortunately only part of the story. This "calculette" covers only a fraction of the tax computation; furthermore, without knowing the crazy semantics and computational rules of the M language, it's very hard to reproduce the tax computation.

As a side-note, the source code appears to have moved here: https://gitlab.adullact.net/dgfip/ir-calcul

Re: A Modern Compiler for the French Tax Code

#77

> In France, income tax is computed from taxpayers' individual returns, using an algorithm that is authored, designed and maintained by the French Public Finances Directorate (DGFiP). This algorithm relies on a legacy custom language and compiler originally designed in 1990, which unlike French wine, did not age well with time. This interesting. When it comes to legacy code we think of COBOL and FORTRAN most of the t…

In my country, with an admittedly quite simple tax code, the authorities used to publish each year official COBOL code that computed income tax. They switched to Java in 2018-ish - and to Github instead of a random FTP server. Doing your taxes has also been a no-op for many people the past decade or so. You don't do anything except read the tax report, unless you spot some mistakes or items missing in the report that…

That's genius.

A buddy of mine retired rich after creating property tax administration systems. They only had a few client counties.

They'd just about rollout new system updates before the next wave of tax code revisions. Never ending work.

Sounded like living hell. I couldn't do that kind of work and stay sane. But he seemed to enjoy it.

Re: A Modern Compiler for the French Tax Code

#78

> In France, income tax is computed from taxpayers' individual returns, using an algorithm that is authored, designed and maintained by the French Public Finances Directorate (DGFiP). This algorithm relies on a legacy custom language and compiler originally designed in 1990, which unlike French wine, did not age well with time. This interesting. When it comes to legacy code we think of COBOL and FORTRAN most of the t…

In Belgium, calculation of the pensions was done in a mix of BS2000 assembly language and COBOL until at least 2007, when they entered a race to switch to Java before the last of the original developers retired.

I worked for an org that tried to modernize, again, their mainframe legacy code, and failed.

I always thought it'd be easier to use an emulator and keep using the old stuff. Then over time whittle the code base down to just the business logic.

Re: A Modern Compiler for the French Tax Code

#79
post #64

Earlier quoted context omitted.

I worked in a similar kind of role recently, in a large public retail company. The only advice I'd give would be to lean hard on finding, maturing, and then advertising end-user champions. Cross-department / -traditional boundary products are frustratingly difficult to push top-down, as the leader of the space that "owns" the product (i.e. IT) doesn't directly see the value, because they're not the end user (business…

Very insightful update, I'll remember it. Thanks!

Thank you for applying your skills to make the world a better place! If everyone did that, we'd all be better off.
Post reply on HN