macros_unstable is merged into macros on a regular basis, once a set of changes has been applied and the tests run.
This is an experimental implementation of OCaml macros, originally designed by Leo White and Jeremy Yallop:
You can find a summary of the current progress here:
This branch is based on version 4.04 of OCaml.
Installation instruction are the same as for the standard OCaml distribution.
You can find a few examples of what is possible in the links above. You can also
take a look at the testsuite/tests/macros/
directory.
Most packages should compile fine, but causes that may break your packages include:
-
a use of the reserved words
static
ormacro
as an identifier; -
a use of
$
as a regular operator.
If you need to install Camlp4, you will have to pin it to this repository. Please be aware that this version of Camlp4 is only provided for backward-compatibility and can only generate "pre-macro" OCaml, i.e. it cannot generate any of the macro constructs.
You are very welcome to try out macros. Please do report any bugs or inconvenience by opening an issue on this repo.
Things to be done sorted by descending priority:
-
Support for declaring static type extensions (including static exceptions)
-
Solve issues of static linking and side effects, possibly by banning the
static
keyword -
Upgrade of
ocamldep
to take into account the modifications in dependency trees because of the above -
Fix GADT matching in quotations
The implementation of macros is an OCaml Labs research project.
Main collaborators:
-
Olivier Nicole, main developer
-
Leo White, quoting library, original design and supervision
-
Jeremy Yallop, original design and supervision
-
Oleg Kiselyov, developer of BER MetaOCaml, from which macros are inspired
-
Gemma Gordon, project manager