Live data from Hacker News

A Modern Compiler for the French Tax Code

arxiv.org

61–70 of 136 posts

Re: A Modern Compiler for the French Tax Code

#61
post #36

Earlier quoted context omitted.

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…

Cool - which country? Could you link to the Github repo?

I think it's Norway.

(I just googled GP's email address (it's in their profile).)

Re: A Modern Compiler for the French Tax Code

#62

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…

I feel like legislation is a field that would benefit a great deal from the progress that software engineering has made in a number of fields. It's already evolved somewhat into a DSL. With some nudging and technical leadership, I suspect that we could move it over entirely into a format that can be readily parsed, tested, and version control. The tax code is especially well-suited to this, because it's a lot of rule…

I heard about the startup Legalese [1] a while ago, which does exactly this.

[1]: https://legalese.com/

Re: A Modern Compiler for the French Tax Code

#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 if you are interested.

Re: A Modern Compiler for the French Tax Code

#64
post #42

Earlier quoted context omitted.

The nearest I've been able to articulate this is lack of overlapping skillsets & departments' tendencies to hire people who look like them. The kind of person who (a) lives in business problem land & (b) is proficient in programming language design (even guided DSL generation)... doesn't exist. At least not in hireable numbers. And those that do are buried deep in the guts of consultancies, who can afford to pay them…

Hi, OP here :) I've come to the same conclusion about programming language creation. However, for a very large organization, it makes sense to have a team in charge of language tooling (see Dropbox/Python, Facebook/Hack/Flow, Apple/Swift). Which is why I'm trying to convince the French state that they should have such a team of permanent people.

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).

What mostly work for me was being as loud as possible with open-attendence educational events, continually taking meetings from interested areas, and then mentoring developing teams.

The goal is to help them create a killer product using your product, such that (highly-placed leader on their side) talks to (your leader) in glowing terms about your product. And that usually happens because your product helped them get a win that moved an important metric to them.

Hint: Ask them about things they've always wanted to do, but couldn't because it was technically impractical. There's probably at least one diamond in there that would be "easy" with your product.

Hint2: Think more broadly about the kind of thing you're trying to do, and get your team in that area. I've worked under CFOs as often as I've worked under CTOs, because "saving money" is near and dear to the former.

(Adapt as necessary to how French government works. Good luck!)

Re: A Modern Compiler for the French Tax Code

#65
post #35

If tax codes are so complex that authorities struggle to maintain the code that implements them, how are humans supposed to understand them well enough to follow the incentives they are designed to create?

Like every other piece of software they are probably spending 90% of their time on edge & corner cases while citizens are spending 90% of their time solidly in the simple core functionality.

Re: A Modern Compiler for the French Tax Code

#66
post #64

Earlier quoted context omitted.

Hi, OP here :) I've come to the same conclusion about programming language creation. However, for a very large organization, it makes sense to have a team in charge of language tooling (see Dropbox/Python, Facebook/Hack/Flow, Apple/Swift). Which is why I'm trying to convince the French state that they should have such a team of permanent people.

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!

Re: A Modern Compiler for the French Tax Code

#67

Translating legal texts to mathematical form is very interesting. It could decimate most legal jobs if a lawsuit can be converted to mathematical form and then 'executed' against the laws that are also in mathematical form. You get your judgement and the explanation as to how that conclusion was reached, all automatically. It could even cause headaches if contradictions in legal judgements are detected. It all relies…

It sounds like what you are describing are Ricardian Contracts. [0] Also worth viewing is this talk by Clay Shirkey on technology tools for Government [1].

Ultimately, I don't see law being automated. As others have pointed out, most cases that go to court are all about interpretation and establishment of the circumstances (did events X, Y and Z happen), interpretation of the law (does law F mean that event X was illegal, and is event Y a mitigator or irrelevant?) and, more elusively, impact (how serious was X?).

What this doesn't mean, though, is that there aren't tools that can't be used in the creation and management of law. If we have a simple dependency tree of documents and sources, we can trigger a review of downstream documents if a document is changed. We can statically check some aspects of the document, like a Legal IDE that would present itself more like an advanced spellcheck. Meta rules can ensure consistency, add in support for in-line reading (include a definition next to a paragraph even though it is defined elsewhere).

Probably the closes thing you'll get to an 'automated' system would be for the 'process' that is currently done by administrators to be partly or fully automated. When charges are brought, a court date is automatically booked. When a judgement is made, a court report is generated, prison alerted etc etc.

Basically, everything that people in tech think should be automated, shouldn't be, and all the things technology people think shouldn't exist should be automated.

[0] https://en.wikipedia.org/wiki/Ricardian_contract

[1] https://www.youtube.com/watch?v=CEN4XNth61o

Re: A Modern Compiler for the French Tax Code

#68

> 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.

Re: A Modern Compiler for the French Tax Code

#69
post #36

Earlier quoted context omitted.

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…

Cool - which country? Could you link to the Github repo?

Yeah, it's Norway.

https://github.com/Skatteetaten/trekktabell

Re: A Modern Compiler for the French Tax Code

#70

I remember when the US tax code was going to be simplified so that an entire tax return form could be printed on a post card.

The majority of tax payers actually don’t have very complex taxes, if you only have w-2 income and don’t itemize deductions, you just need the single page 1040. Even small businesses aren’t complicated if they have proper bookkeeping, or if you’re just deducting mortgage interest. The piles of tax regulations really are for wealthy people and corporations with complicated accounting.
Post reply on HN