mina icon indicating copy to clipboard operation
mina copied to clipboard

Replace ppx_optcomp

Open ylecornec opened this issue 2 years ago • 1 comments

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 Unix and can be compiled to js.

Leads:

  • Could these configurations be handled by dune using functionalities such as virtual libraries and/or enabled_if attributes ?

ylecornec avatar Aug 03 '22 13:08 ylecornec

Could these configurations be handled by dune using functionalities such as virtual libraries and/or enabled_if attributes ?

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.

mrmr1993 avatar Aug 03 '22 14:08 mrmr1993

#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.

robinbb avatar Oct 11 '22 23:10 robinbb