Commit Graph

26 Commits

Author SHA1 Message Date
Denis Merigoux
8288754de2
JSOO runtime fix 2024-05-03 09:35:20 +02:00
Louis Gesbert
facce68b25 Make refactored runtime error messages clearer
mostly reverting to the ones the interpreter was printing ; for the case of
divisions, we choose to point to the denominator instead of the operator as it's
where the only possible error (division by zero) comes from.
2024-05-02 16:30:47 +02:00
Louis Gesbert
9d07015864 Unify runtime error handling
- Clearly distinguish Exceptions from Errors. The only catchable exception
  available in our AST is `EmptyError`, so the corresponding nodes are made less
  generic, and a node `FatalError` is added

- Runtime errors are defined as a specific type in the OCaml runtime, with a
  carrier exception and printing functions. These are used throughout, and
  consistently by the interpreter. They always carry a position, that can be
  converted to be printed with the fancy compiler location printer, or in a
  simpler way from the backends.

- All operators that might be subject to an error take a position as argument,
  in order to print an informative message without relying on backtraces from
  the backend
2024-04-26 18:31:26 +02:00
Louis Gesbert
21a429bfcf Jsoo runtime: fix over-wrapping of event manager callbacks 2024-03-12 16:05:38 +01:00
Louis Gesbert
959a49ee92 Jsoo runtime: expose the event manager to JS 2024-03-12 16:04:59 +01:00
Louis Gesbert
ff06ddf40c Fixing linking across modules for backends
- This adds a `catala depends` command that recursively tracks module dependency.
It can then be used by Clerk for linking.

- Generation of cmo object files are added for OCaml (we only built native
objects, but jsoo requires bytecode).

- Some fixes to the generation of value embed/deembed shims (related to types
coming from different modules ; add support for options ; etc.)
2024-03-08 17:36:00 +01:00
Louis Gesbert
e0928677b1 Small ocaml/js output rehaul
Print to json directly rather than depend on yojson and a ppx.

Note: this should be tested with the website in order to validate that the Json
output is 1-to-1.
(a second step could be to simplify this output, now that it's manual)
2024-02-21 11:28:56 +01:00
Louis Gesbert
4910158aea Reformat 2023-09-01 16:24:27 +02:00
Denis Merigoux
8987d358e7
Implement the rest 2023-05-26 16:54:52 +02:00
Denis Merigoux
7d278caa30
Update OCaml assets 2023-04-04 15:19:08 +02: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
Denis Merigoux
6130151c8e
Fix bug and typos 2022-09-05 14:50:37 +02:00
Emile Rolley
ba620fca28 ocamlformat: new break-infix rule 2022-08-05 10:55:48 +02:00
Emile Rolley
1a6934b538 feat(build): add the generation of json schemas to the build workflow 2022-07-29 18:47:42 +02:00
Emile Rolley
26663f227d fix(plugins/web): fix enum payload + retrieve all required types 2022-07-29 18:42:47 +02:00
Emile Rolley
8e3fd34424 refactor(plugins/jsoo): encode Catala date in JS string object instead of date 2022-07-29 18:42:41 +02:00
Denis Merigoux
4845196b5b Add source positions in all backends exceptions 2022-07-29 18:42:14 +02:00
Emile Rolley
6e825906de refactor(api_web): factorizes the api_web code + updates .gitattributes 2022-07-28 15:02:43 +02:00
Emile Rolley
d9045499c0 refactor(french_law/ocaml): refactor the api_web.ml 2022-07-22 17:01:33 +02:00
Emile Rolley
3ab5129572 feat(jsoo): add conversion fun generation (except mutiple cons args) 2022-07-22 16:52:56 +02:00
Emile Rolley
7ad81158eb feat(runtime/jsoo): add date conversion functions 2022-07-22 16:52:56 +02:00
Emile Rolley
b2bba6eaf0 feat(jsoo): factorize log events related function to the object eventManager 2022-07-22 16:52:56 +02:00
Emile Rolley
d3d254033c feat(runtimes/jsoo): add a new class type duration with conv functions 2022-07-22 16:52:56 +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