Commit Graph

14 Commits

Author SHA1 Message Date
Louis Gesbert
f9e3964621 Add an explain plugin
Based on the lazy_interp plugin, this new plugin generates a `dot` graph
retracing a given computation from source definitions to the results.
2023-07-11 17:33:56 +02:00
Denis Merigoux
107ff95dc4
Remove dependency on ppx_expect and use alcotest instead 2023-04-21 10:37:31 +02:00
Louis Gesbert
660e5775de Rename utils to catala_utils 2022-11-28 16:38:09 +01:00
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
Louis Gesbert
bc8eda581c Add a script generating static builds
We have an obvious limitation: static builds won't support plugins. We
could resort to the classic method and do normal builds but on an old
distrib to dodge compatibility issues.

That would still be compatible with statically linking the more specific
libs, like e.g. z3.
2022-08-03 19:04:14 +02:00
Emile Rolley
0c180e12f9 refactor(runtimes): add runtime_ocaml and runtime_jsoo in the catala package 2022-07-22 16:52:56 +02:00
Emile Rolley
c09b457988 refactor(runtimes): add move the OCaml runtime into runtimes/ocaml 2022-07-22 16:52:56 +02:00
Louis Gesbert
4c43b533b0
Merge pull request #213 from AltGr/plugin-support
Add backend plugin support
2022-05-25 18:31:30 +02:00
Emile Rolley
92ebb4194b refactor(api_web/runtime): runtime_value derive yojson_of 2022-05-25 14:26:58 +02:00
Louis Gesbert
9a95a3554c Add support for backend plugins using dynlink 2022-05-19 10:40:02 +02:00
Denis Merigoux
743a1b74c9
Renamed and grouped modules cleanly 2022-01-08 18:37:04 +01:00
Denis Merigoux
29f12aa3cb
Building a JS version of the Catala compiler 2021-11-12 10:07:13 +01:00
Denis Merigoux
1313183353
Defining a new intermediate representation 2021-06-22 16:01:57 +02:00
Denis Merigoux
bbd50747d9
Big renaming and dir reorg 2021-06-21 11:39:06 +02:00