Add an option to disable Michelson checks to compile expression
In order to compile the Checker project efficiently, I want to compile all its entrypoints in parallel (the project is following the so-called lambda pattern) instead of calling the compiler several times. This can be done using a big record expression, of the form { x1 = Bytes.pack entrypoint1 ; x2 = Bytes.pack entrypoint2 ; … }
.
Unfortunately, the resulting expression has a pretty large type, and the compiler refuses it with the following message:
Error(s) occurred while parsing the Michelson input:
At (unshown) location 0, type exceeded maximum type size (2001).
Following @tomjack's advice, changing michelson_maximum_type_size
to a much larger number fixes this and allows to compile the contract. However, this makes the distribution of the Checker project strongly impractical, as it requires vendoring a specific version of the compiler.
It would be much nicer to give an option to the compiler to skip chose checks. It seems that the compile contract
command already has a --disable-michelson-typechecking
, but I don't know if it's relevant here, as I am specifically compiling an expression.
Caveat: of course the record trick is a temporary workaround before adding a better support of the lambda pattern and/or parallel compilation to the compiler, but I believe that will do for now. This trick makes the compilation of the whole project drastically faster and I'd like to keep it without having to call the compiler several times in parallel.