[2011.07966] A Modern Compiler for the French Tax Code
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. 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.
A Modern Compiler for the French Tax Code Denis Merigoux∗ Raphaël Monat∗ Jonathan Protzenko Inria Sorbonne Université, CNRS, LIP6 Microsoft Research Paris, France Paris, France USA denis.merigoux@inria.fr…
saved by
related reading
- A friendly introduction to machine learning compilers and optimizershuyenchip.com
- The LLVM Compiler Infrastructure Projectllvm.org
- Writing a C compiler in 500 lines of Pythonvgel.me
- [2203.07814] Competition-Level Code Generation with AlphaCodearxiv.org
- A Gentle Introduction to LLVM IR · mcyoungmcyoung.xyz
- Google's Fully Homomorphic Encryption Compiler — A Primer || Math ∩ Programmingjeremykun.com
- Building a Performant Compiler from Scratch — Bowen Chengbowencheng.dev
- Compiling ML models to C for fun | Max Bernsteinbernsteinbear.com
- Why ML/OCaml are good for writing compilersflint.cs.yale.edu
- How Compiler Explorer Works in 2025 — Matt Godbolt’s blogxania.org
- Against Query Based Compilersmatklad.github.io
- What even is compiler correctness?williamjbowman.com