Commit Graph

103 Commits

Author SHA1 Message Date
Louis Gesbert
7b43f393c5 Add some optimisations to nested maps 2024-02-05 11:01:55 +01:00
Louis Gesbert
d60b521a4e Fix Python backend and CI 2024-02-01 01:01:04 +01:00
Denis Merigoux
b48fb0e223
Array compilation to C is OK 2024-01-26 20:15:32 +01:00
Denis Merigoux
a39b67bf12
Merge branch 'master' into c_backend 2024-01-26 17:43:07 +01:00
Louis Gesbert
371f9554b8 Support for list recombinations
The primary use-case for this was to be able to run computations on a list of
structures, then return an updated list with some fields in the structures
modified : that is what we need for distribution of tax amounts among household
members, for example.

This patch has a few components:

- Addition of a test as an example for tax distributions

- Added a transformation, performed during desugaring, that -- where lists are
  syntactically expected, i.e. after the `among` keyword -- turns a (syntactic)
  tuple of lists into a list of tuples ("zipping" the lists)

- Arg-extremum transformation was also fixed to use an intermediate list instead
  of computing the predicate twice

- For convenience, allow to bind multiple variables in most* list
  operations (previously only `let in` and functions allowed it)

- Fixed the printer for tuples to differentiate them from lists

*Note: tuples are not yet allowed on the left-hand side of filters and
arg-extremums for annoying syntax conflict reasons.
2024-01-26 11:29:33 +01:00
Louis Gesbert
bc90a7b890 Add (internally) a map2 operator 2024-01-26 11:22:12 +01:00
Denis Merigoux
8a139f6a3c
Work on arrays 2024-01-22 16:49:58 +01:00
Louis Gesbert
db6c8c6c16 Add missing python package file 2024-01-19 13:39:22 +01:00
Denis Merigoux
349da741d4
Merge branch 'master' into c_backend 2024-01-16 16:23:35 +01:00
Louis Gesbert
e0c2c58687 Makefile: remove references to the examples 2024-01-16 11:54:28 +01:00
Louis Gesbert
538e97dfd3 Install Python and R runtimes
Runtimes for the various backends are expected to be made available from their
own ecosystem. However, for convenience and to help with development
settings (where the runtime might change), as part of installing catala they are
put, in source form, into `<prefix>/lib/catala/runtime_LANG`.

When using a dev version of Catala, and using Python, one would then just have
to do `pip install <prefix>/lib/catala/runtime_python` within their venv to be
able to run their python programs.
2024-01-16 11:54:28 +01:00
Pierre Goutagny
6a39d066f2
Unify rounding operations in OCaml runtime 2024-01-10 13:43:19 +01:00
Denis Merigoux
fe5b842a03
Simple example compiles and runs fine 2023-12-13 16:58:02 +01:00
Denis Merigoux
d88f67bb2c
Progress 2023-12-12 16:08:40 +01:00
Louis Gesbert
cf89204a4b Reformat 2023-11-27 11:17:38 +01:00
adelaett
a734413d39 typing default: fix ocaml runtime when using eoption 2023-11-27 11:17:38 +01:00
adelaett
ae4956c40f Typing defaults: update ocaml & python runtimes. 2023-11-27 11:17:38 +01:00
Denis Merigoux
fc242a5d1f
Fix Python compilation and runtime 2023-11-22 18:08:44 +01:00
Louis Gesbert
4910158aea Reformat 2023-09-01 16:24:27 +02:00
Denis Merigoux
6d7b1f2585
Last fixes 2023-08-07 17:55:04 +02:00
Denis Merigoux
8743b73459
Debugging the R backend 2023-08-07 16:19:13 +02:00
Denis Merigoux
4d419ac167
Switch to S4 classes and package runtime 2023-08-07 15:58:55 +02:00
Denis Merigoux
695faebefb Cleaning up 2023-08-05 16:23:29 +02:00
Denis Merigoux
e2f8e56e7d Backend seems to work, needs more debugging 2023-08-05 14:28:18 +02:00
Denis Merigoux
62ea40a40d Fix tryWith compilation 2023-08-05 13:05:31 +02:00
Denis Merigoux
d0483d681a
First test passing 2023-08-04 19:30:43 +02:00
Denis Merigoux
fe9143a304
More complete runtime 2023-08-04 16:50:00 +02:00
Denis Merigoux
f28a1a8a90
Ported Catala runtime to R 2023-08-04 15:21:19 +02:00
Micah Cantor
3b1c23c054 add explicit yojson open 2023-08-02 12:17:28 +02:00
Louis Gesbert
8920564f9e Fix some documentation comments formatting 2023-07-04 10:01:51 +02:00
Louis Gesbert
89e90271c1 Implement an additional localised, user-facing value printer 2023-07-03 16:42:54 +02:00
Louis Gesbert
0f9ee2c72e Refacter the main Driver module
- Use separate functions for successive passes in module `Driver.Passes`
- Use other functions for end results printing in module `Driver.Commands`

As a consequence, it is much more flexible to use by plugins or libs and we no
longer need the complex polymorphic variant parameter.

This patch leverages previous changes to use Cmdliner subcommands and
effectively specialises the flags of each Catala subcommand.

Other changes include:

- an attempt to normalise the generic options and reduce the number of global
  references. Some are ok, like `debug` ; some would better be further cleaned up,
  e.g. the ones used by Proof backend were moved to a `Proof.globals` module and
  need discussion. The printer no longer relies on the global languages and prints
  money amounts in an agnostic way.
- the plugin directory is automatically guessed and loaded even in dev setups.
  Plugins are shown by the main `catala` command and listed in `catala --help`
- exception catching at the toplevel has been refactored a bit as well; return
  codes are normalised to follow the manpage and avoid codes >= 128 that are
  generally reserved for shells.

Update tests
2023-07-03 16:42:54 +02:00
Louis Gesbert
e224e87f71 Wip support for modules
(first working dynload test with compilation done by manual calls to ocaml)

A few pieces of the puzzle:

* Loading of interfaces only from Catala files
* Registration of toplevel values in modules compiled to OCaml, to allow access
  using dynlink
* Shady conversion from OCaml runtime values to/from Catala expressions, to
  allow interop (ffi) of compiled modules and the interpreter
2023-06-15 17:56:57 +02:00
Denis Merigoux
4612920bf4
Merge branch 'master' into more_infos_in_logs 2023-06-01 17:38:41 +02:00
Denis Merigoux
6b4693bb8b
Too much directory restriction 2023-05-30 14:06:52 +02:00
Denis Merigoux
94999dcc25
Correctly generate latex, nowrap option not working anymore? 2023-05-30 12:03:50 +02:00
Emile Rolley
16088a74ab pkg(rescript): @catala-lang/rescript-catala v0.8.1-b.0 2023-05-29 12:28:34 +02:00
Denis Merigoux
fa9f432e8b
Python runtime OK now 2023-05-26 17:08:26 +02:00
Denis Merigoux
8987d358e7
Implement the rest 2023-05-26 16:54:52 +02:00
Emile Rolley
86121308fe publish(runtimes/rescript): @catala-lang/rescript-catala v0.8.0 2023-05-07 15:13:22 +02:00
Emile Rolley
77b42d9e29 publish(runtimes/rescript): @catala-lang/rescript-catala v0.1.1 2023-05-07 15:13:22 +02:00
Emile Rolley
b4372a965d refactor(runtimes/rescript): rename Runtime into CatalaRuntime 2023-05-07 15:13:22 +02:00
Emile Rolley
2a39f1b5f8 feat(runtimes): add rescript-catala 2023-05-07 15:13:22 +02:00
adelaett
32b45984ab
remove serialization of runtime.ml values 2023-04-14 14:13:34 +02:00
adelaett
cc66023e51
Thunking justifications and conclusion in avoid_translation pass 2023-04-12 10:58:21 +02:00
alain
ec40de83fc
Merge branch 'master' into adelaett-withoutexceptionsfix 2023-04-06 13:57:22 +02:00
Denis Merigoux
7d278caa30
Update OCaml assets 2023-04-04 15:19:08 +02:00
adelaett
6dee3874cc Merge branch 'master' into adelaett-withoutexceptionsfix 2023-03-30 10:50:32 +02:00
Raphaël Monat
7021c41f93 Add date rounding option within scopes 2023-03-16 16:55:55 +01:00
Emile Rolley
b2383d33bc fix(runtimes/ocaml): rename fun_call.inputs into fun_call.fun_inputs 2023-03-11 17:37:24 +01:00