Commit Graph

91 Commits

Author SHA1 Message Date
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
Louis Gesbert
42b8adb968 Add a duration / duration overload
Interstingly enough, it was already implemented in the Python backend.

Required to implement *pro rata temporis*, which the US tax section 121 does
make use of.

Only allowed for durations expressed in days (as returned by `<date> - <date>`),
of course.
2023-03-08 15:17:58 +01:00
adelaett
b5f3621302 serialization wip 2023-02-27 11:20:59 +01:00
adelaett
13685b3fce correct logs parsing in the runtime 2023-02-24 12:04:45 +01:00
adelaett
5000057dde new parser/formater in runtimes/ocaml/runtime.ml 2023-02-23 17:17:25 +01:00
Denis Merigoux
830ec0e60c
Python runtime: Fix source positions linked to run-time errors (#401) 2023-02-21 10:27:01 +01:00
Rohan Padhye
940485dca4
Python runtime: Money division can simply use Integer division to remain rational
This is cleaner than referencing `mpq` explicitly, as it still returns a `Decimal` with full rational (non-floating) precision.
2023-02-20 22:40:05 -05:00
Rohan Padhye
6c1963e7dd
Python runtime: Money division should remain rational
Fixes #402
2023-02-20 22:34:03 -05:00
Rohan Padhye
e7a331a2ae Python runtime: Fix source positions linked to run-time errors 2023-02-20 15:49:53 -05:00
Rohan Padhye
4c9bff1b74 Python backend: Date difference should always return duration in days 2023-02-14 13:48:19 -05:00
Denis Merigoux
b3057e1d7c
Continue cleaning 2023-01-07 20:42:42 +01:00
Denis Merigoux
2f4a51ce64
Bug fixed! It was tricky 2023-01-07 20:22:36 +01:00
Denis Merigoux
c723249337
Managed to find a MWE of the bug 2023-01-06 17:07:43 +01:00