package catala

  1. Overview
  2. Docs
Low-level language for tax code specification

Install

Dune Dependency

Authors

Maintainers

Sources

0.3.0.tar.gz
md5=4a2c5495f30d8fc2e3bf977df6e602f9
sha512=8dcc404b6068b9dbd76982ade60d8fba1950fdd0a8a626db17429120483367dce1f51997e96d7b8ee5308f305c3bcbb897ef85336f25e9ef3681f4cb9237f56a

doc/index.html

The Catala compiler

Architecture

The architecture of the Catala compiler is inspired by CompCert or the Nanopass framework, and is structured around many intermediate representations connected by successive translations passes.

Here is the recap picture of the different intermediate representations of the Catala compiler (made with an ASCII diagram tool):

                                     +---------------+   
                                     |               |   
                                     |  Surface AST  |   
                                     |               |   
                                     +---------------+   
                                             |           
         * Separate code from legislation    |           
         * Remove syntactic sugars           |           
                                             v           
                                     +---------------+   
                                     |               |   
                                     | Desugared AST |   
                                     |               |   
                                     +---------------+   
                                             |           
 * Build rule trees for each definition      |           
 * Order variable computations inside scope  |           
                                             v           
                                  +--------------------+ 
                                  |                    | 
                                  | Scope language AST | 
                                  |                    | 
                                  +--------------------+ 
                                             |           
        * Convert scopes into functions      |           
        * Thunking of subscope arguments     |           
                                             |           
                                             v           
                                 +----------------------+
                                 |                      |
                                 | Default calculus AST |
                                 |                      |
                                 +----------------------+

List of top-level modules

Each of those intermediate representation is bundled into its own `dune` bundle module. Click on the items below if you want to dive straight into the signatures.

More documentation can be found on each intermediate representations here.

The main compilation chain is defined in:

Last, two more modules contain additional features for the compiler:

OCaml

Innovation. Community. Security.