4ae392c900
Many changes got bundled in here and would be too tedious to separate. Closes #330 See changes in `shared_ast/definitions.ml` to check the main point. - the biggest change is a modification of the struct and enum types in expressions: they are now stored as `Map`s throughout passes, and no longer converted to indexed lists after scopelang. Their accessors are also changed, and tuples only exist in Lcalc (they're used for closure conversion). This implied adding some more information in the contexts, to keep the mapping between struct fields and scope output variables. It should also be much more robust (no longer relying on assumptions upon different orderings). - another very pervasive change is more cosmetic: the rewrite of the main AST to use inline records, labelling individual subfields. - moved the checks for correct definitions and accesses of structures from `Scope_to_dcalc` to `Typing` - defining some new shallow iterators in module `Shared_ast.Expr`, and factorising a few same-pass rewriting functions accordingly (closure conversion, optimisations, etc.) - some smaller style improvements (ensuring we use the proper compare/equal functions instead of `=` in a few `when` closes, for example) |
||
---|---|---|
.. | ||
catala_legifrance | ||
js | ||
ocaml | ||
python | ||
README.md |
French Law Libraries
This folder presents a working example of how Catala could be distributed and deployed inside existing applications. Each sub-folder is specialized for a particular programming language, and features a ready-to-use library of all the French public algorithms coded up using Catala so far.
General principles
Let us say you want to deploy a Catala program inside an application written
in programming language X. The Catala compiler will translate the source
Catala program into X, yielding a new .x
source code file. This .x
file
will export functions corresponding to the scopes of the original Catala
program. You can then reuse those exported functions in your application written
in X.
OCaml
To see how to deploy Catala programs as an OCaml library, see the dedicated readme.
JS
To see how to deploy Catala programs as a JS library, see the dedicated readme.
Python
To see how to deploy Catala programs as a Python library, see the dedicated readme.