Live data from Hacker News

Compiler for the M language of the French DGFiP

gitlab.inria.fr

11–20 of 68 posts

Re: Compiler for the M language of the French DGFiP

#11
Really interesting to see this. I'm a co-founder of AdviceBridge, where we have implemented part of the UK tax code related to income tax and pensions in order to provide digital financial advice.

In the UK, the HMRC (again, equivalent of IRS) makes worksheets available for computational tax but these are not machine-readable and are not guaranteed to be correct! (Indeed on some points, government websites give incorrect information related to the state pension. [1])

We did something similar to this approach but much simpler - we wrote a little arithmetic language specifying the tax rules, embedded in a spreadsheet for quick verification, and then translated this language into C++ using a Haskell compiler.

[1] https://www.thisismoney.co.uk/money/pensions/article-7100019...

Re: Compiler for the M language of the French DGFiP

#14
post #5

Earlier quoted context omitted.

is there an initiative like this in the US?

Doubt it. The Intuit and HR Block lobbying dollars make sure our tax system is complicated enough to keep their businesses booming.

Petitions are free, right? Unless it actually does exist, it makes sense to start one.

Re: Compiler for the M language of the French DGFiP

#16
Something seems off with the current repo being pointed to. The repo Readme says:

  This work is based on a retro-engineering of the syntax
  and the semantics of M, from the codebase released by the
  DGFiP.
Sounds like an external re-implementation, of the "original" release here:

https://framagit.org/dgfip/ir-calcul

That original release says it's under a free license too.

Wonder why there's a re-implementation?

Re: Compiler for the M language of the French DGFiP

#17
I have implemented parts of the tax code, following 1040 and the network of forms it references line-by-line, for my own financial planning. I've been selective about what I implement based on what applies to me.

I don't share the code because I'm not sufficiently confident that it's correct, don't want liability, and don't want an obligation to keep it up to date.

That said, it feels like the scope of the project would be manageable for a small nonprofit, and would be of great social value. One reflection from my work is that it would be particularly valuable to represent annual changes in the tax code as transformations of the code AST.

Re: Compiler for the M language of the French DGFiP

#18

Something seems off with the current repo being pointed to. The repo Readme says: This work is based on a retro-engineering of the syntax and the semantics of M, from the codebase released by the DGFiP. Sounds like an external re-implementation, of the "original" release here: https://framagit.org/dgfip/ir-calcul That original release says it's under a free license too. Wonder why there's a re-implementation?

The author explains in the twitter thread (french):

https://twitter.com/DMerigoux/status/1314531302079688709

> The difficulty arose from a constraint on the part of the DGFiP which did not wish to publish, for security reasons, part of the logic of the calculation corresponding to the "multiple liquidations" mechanism. Raphael and I recreated this unpublished part in a new DSL.

> The DGFiP also did not wish to publish its internal test sets. We therefore proceed to the creation of a completely random test set, from the unpublished content, in order to be able to reproduce the validation of Mlang outside the DGFiP.

> A little less than a year after the publication of https://blog.merigoux.ovh/en/2019/12/20/taxes-formal-proofs...., we therefore found a compromise allowing to respect both the 'source code publication obligation, and the security constraints of the DGFiP.

> By allowing us to go to its operating site and confidentially access the source code that it did not wish to publish, the DGFiP has enabled us to find alternative solutions that make the publication of the source code concrete and operational. .

Re: Compiler for the M language of the French DGFiP

#19
post #5
post #2

Very good news. Consider signing the petition to make all publicly funded code free: https://publiccode.eu .

is there an initiative like this in the US?

Code directly written be the Government must be public domain. I'm not sure this is a step in the right direction, or a step backwards as it just pushes more software engineering to consultants.

(I've at least seen DARPA-funded work become open source. That's a good step.)

Re: Compiler for the M language of the French DGFiP

#20

Something seems off with the current repo being pointed to. The repo Readme says: This work is based on a retro-engineering of the syntax and the semantics of M, from the codebase released by the DGFiP. Sounds like an external re-implementation, of the "original" release here: https://framagit.org/dgfip/ir-calcul That original release says it's under a free license too. Wonder why there's a re-implementation?

[deleted]
Post reply on HN