catala/compiler/plugins
Louis Gesbert 4ae392c900 AST refactoring
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)
2022-11-17 18:16:09 +01:00
..
api_web.ml AST refactoring 2022-11-17 18:16:09 +01:00
dune refactor(compiler): split web plugin into api_web and json_schema + factorize some util functions 2022-07-29 18:42:47 +02:00
json_schema.ml AST refactoring 2022-11-17 18:16:09 +01:00
plugins.mld feat(build): add the generation of json schemas to the build workflow 2022-07-29 18:47:42 +02:00
python.ml ocamlformat: new break-infix rule 2022-08-05 10:55:48 +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.