A Modern Compiler for the French Tax Code

Denis Merigoux, Raphaël Monat, Jonathan Protzenko
11/16/2020
cs.PL

Official code: MLanguage/mlang (204 stars, Forth, GPL-3.0, last commit 2026-01-20).

Abstract

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.

Show full abstract

Owing to the shortcomings of the input language and the technical limitations of the compiler, the algorithm is proving harder and harder to maintain, relying on ad-hoc behaviors and workarounds to implement the most recent changes in tax law. Competence loss and aging code also mean that the system does not benefit from any modern compiler techniques that would increase confidence in the implementation. We overhaul this infrastructure and present Mlang, an open-source compiler toolchain whose goal is to replace the existing infrastructure. Mlang is based on a reverse-engineered formalization of the DGFiP's system, and has been thoroughly validated against the private DGFiP test suite. As such, Mlang has a formal semantics; eliminates previous handwritten workarounds in C; compiles to modern languages (Python); and enables a variety of instrumentations, providing deep insights about the essence of French income tax computation. The DGFiP is now officially transitioning to Mlang for their production system.

View on arXivView PDF

Code Implementations(1)

MLanguage/mlangOfficial100%
GPL-3.0

Compiler for the M language, used to compute the income tax of French taxpayers

20416Forth, OCamlDec 5, 202010 months agoGPL-3.0

Similar Papers

Cite this paper

@article{merigoux2020modern,
  title  = {A Modern Compiler for the French Tax Code},
  author = {Denis Merigoux and Raphaël Monat and Jonathan Protzenko},
  year   = {2020},
  eprint = {2011.07966},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2011.07966}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2011.07966.svg)](https://codeofpaper.com/paper/2011.07966)

Discussion