catala
catala copied to clipboard
Module support (tracking issue)
trafficstars
Synthetic overview of where module support is currently at
-
Module interface: the
catala-metadatasections of a normal Catala file -
Module name based upon filename at the moment
- [x]
> Moduledirectives
- [x]
-
Compiling modules
- [x] introduce a dynlink registration of compiled catala modules into the OCaml runtime for use by the interpreter
- [x] add a module hash based on interface + Catala version
- [x] facility to compile module to
cmxsdirectly
-
Using module interfaces (in the compiler)
- [x] declare use using the CLI
- [x] or a
Usingdirective - [x] register toplevel values
- [x] register toplevel scopes
- [x] register type defs
-
Using module implementations (in the interpreter)
- [x] load the cmxs of the module through dynlink
- [x] Validate the module hash to ensure consistency of the interface & backend
- [x] Call the external functions with back-and-forth translation between exprs and runtime values
- [x] (the above needs more tests. Come on, no segfault yet ??!)
-
Using module implementations (OCaml backend)
- [x] Manually compiled modules can be linked together using
ocamlopt - [x] Some facility to handle the compile command ?
- [x] Manually compiled modules can be linked together using
-
Using module implementations (other backends)
- [ ] For js: see how to port the OCaml linking command to jsoo
- [ ] TODO (later)
-
Native modules (aka externals)
- [x] it's possible to manually provide the .ml file for a module
- [ ] facilities to extract the expected mli interface from a catala file
- [x] facilities to correctly compile the external modules
-
Replacing the monomorphic operators
- [ ] define an (auto opened) stdlib module
- [ ] move the operators from the backend to there and adjust the compiler (TODO)
-
Extend all of the above to the other runtimes, providing a suitable stdlib
- [x] jsoo
- [x] Python
- [ ] Others ??