catala/compiler/shared_ast
Louis Gesbert 5d432d6bb9 OCaml runtime: register fallback exception printers
This was a pending TODO: now the Catala program compiled into OCaml should
return better messages and a little more information about uncaught exceptions.

Note that this also concerns, at the moment, compiled modules called from the
Catala interpreter: in this case, it's already better than nothing, but what we
need is proper interoperation between the runtime exceptions and the interpreter
handling (`EmptyError` should already be handled properly since it is critical
to the computation flow, but "error" exceptions are left uncaught and will kill
the interpreter).

This may be part of a bigger task on unifying the output of the runtime and
toplevel, which also concerns computation traces.

Note 2: All runtime exceptions don't have a position available, which is quite
unfortunate when your program hits an error. With `OCAMLRUNPARAM=b` and if
compiled with `-g` (which should normally be the case), you can get an OCaml
backtrace but that's not very friendly. Ideas for improvement:
- The runtime could force-enable backtrace recording (`Printexc.record_backtrace
  true`) to supersede the need for `OCAMLRUNPARAM`. We can also record our own
  handler to print the file position and/or backtrace in the way we see fit
- The printer of OCaml code in Catala could insert line directives so that the
  positions in the backtrace actually trace automatically back to the Catala
  code
- If we don't want to leverage any OCaml machinery in this way, the compiler
  should add position information to any operator that might fail (e.g.
  divisions, date comparisons, etc.).
Note that running in trace mode might already help pinpoint the location of the
error ?
2024-04-15 14:13:33 +02:00
..
boundList.ml Generalise the definition of lists of nested binders 2024-02-09 18:33:41 +01:00
boundList.mli Generalise the definition of lists of nested binders 2024-02-09 18:33:41 +01:00
definitions.ml Support for structure updates 2024-04-12 17:17:48 +02:00
dune Fix most doc errors 2023-06-02 17:17:45 +02:00
expr.ml Support for structure updates 2024-04-12 17:17:48 +02:00
expr.mli Support for structure updates 2024-04-12 17:17:48 +02:00
interpreter.ml OCaml runtime: register fallback exception printers 2024-04-15 14:13:33 +02:00
interpreter.mli Move global options of Cli to their own module 2024-03-19 15:18:35 +01:00
operator.ml Message: further simplification 2024-04-10 19:26:23 +02:00
operator.mli Fix most doc errors 2023-06-02 17:17:45 +02:00
optimizations.ml Move global options of Cli to their own module 2024-03-19 15:18:35 +01:00
optimizations.mli Improve integration of marks into the main AST 2023-05-17 17:37:00 +02:00
print.ml Support for structure updates 2024-04-12 17:17:48 +02:00
print.mli Reformat 2024-03-20 14:41:06 +01:00
program.ml Add externals to scalc, working test with Python backend 2024-02-26 14:56:43 +01:00
program.mli Add externals to scalc, working test with Python backend 2024-02-26 14:56:43 +01:00
qident.ml Add some helper functions in a wrapper Map module 2023-07-12 11:51:15 +02:00
qident.mli Some commented code cleanup and clarifications 2023-06-19 16:36:09 +02:00
scope.ml Generalise the definition of lists of nested binders 2024-02-09 18:33:41 +01:00
scope.mli Generalise the definition of lists of nested binders 2024-02-09 18:33:41 +01:00
shared_ast.ml Generalise the definition of lists of nested binders 2024-02-09 18:33:41 +01:00
shared_ast.mld Fix most doc errors 2023-06-02 17:17:45 +02:00
type.ml Formatting 2024-02-01 17:22:42 +01:00
type.mli Define Type.Map 2024-02-01 10:10:25 +01:00
typing.ml Support for structure updates 2024-04-12 17:17:48 +02:00
typing.mli Typing: add a "assume operator types" mode 2024-02-07 17:41:04 +01:00
var.ml Fixes related to environments and lookups 2023-08-31 18:31:48 +02:00
var.mli Fixes related to environments and lookups 2023-08-31 18:31:48 +02:00