mina
mina copied to clipboard
Replace ppx_optcomp
As noted in the Codebase Improvement Ideas on notion, ppx_optcomp should be replaced by something else.
It seems that the main use of this preprocessor is to be able to compile the code in multiple configurations, that are defined in the
src/config folder.
From what I noticed in the code base there are two important cases in particular:
- The consensus mode: the "normal" mode.
- The nonconsensus mode: Removes dependencies on platform specific libraries such as
Unixand can be compiled to js.
Leads:
- Could these configurations be handled by dune using functionalities such as virtual libraries and/or
enabled_ifattributes ?
Could these configurations be handled by dune using functionalities such as virtual libraries and/or
enabled_ifattributes ?
That should get rid of most of the uses of optcomp, yes.
To remove the nonconsensus optcomp, we'll probably need to restructure the code so that Mina_base doesn't depend on pickles (or anything else that depends on Kimchi_bindings). I suspect that the work to extract the types in #11101 will make this significantly easier. There will probably also have to be some tweaks to Snark_params and friends to avoid pulling in dependencies from Kimchi_backend too.
#11101 is now complete, but has a follow-on task, #11771. So, @mrmr1993's comment (that this issue will be easier after that work) applies to that new issue.