catala/compiler/plugins
Louis Gesbert edb8db9ada Implement expansion of equality tests
This adds an optional pass that recursively expands equality tests across
structures and enums, on lcalc.

NOTE: this is a temporary solution.

- all tests are completely inlined, which may be a bit bloated
- due to the lack of primitives (and expressive pattern-matching), checking
  equality on enums generates a 2-level pattern matching, quadratic in the
  number of constructors
- this is completely separate from the monomorphisation pass, which morally
  should take care of generating this code (as specific functions rather
  than inlined code)

So, while this should work as a place-holder for now, it actually seems more
reasonable mid-term (before we do it through monomorphisation) to do this
translation at the backend level, i.e. when generating the C code, when we have
full access to the representation of enums.
2024-08-09 11:54:34 +02:00
..
api_web.ml Implement expansion of equality tests 2024-08-09 11:54:34 +02:00
dune Rework module includes CLI in Catala 2023-09-27 13:14:40 +02:00
explain.ml Implement expansion of equality tests 2024-08-09 11:54:34 +02:00
json_schema.ml Implement expansion of equality tests 2024-08-09 11:54:34 +02:00
lazy_interp.ml Remove the with-exceptions backend 2024-07-04 15:08:13 +02:00
plugins.mld Remove generated files from git 2023-07-10 15:48:11 +02:00
python.ml Implement expansion of equality tests 2024-08-09 11:54:34 +02:00
README.md Documentation about plugins 2022-08-09 15:00:13 +02:00

Catala compiler plugins

You want to add a customized backend for the Catala compiler but don't want to modify its source code? Thanks to dynamic linking, it is possible to do so. The advantage of creating a customized backend is the possibility to craft a generated target code that perfectly matches the naming conventions, module structure or coding style of your application.

See the online documentation for more details on how to create them, or look at the existing plugins in this directory for inspiration.