Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Push/Enter and Constant Propagation for Michelson #305
This commit will also add a size parameter to the stack, that way we don't have to do length checks all the time.
Constant values will be stored on this stack (inefficient to lookup!), however they won't count towards the length of the stack, and will be noted as a skip when looking up offsets!
Currently tracing the `termToInstr=
We get something akin to this
let f a = (+) a f 2 3
We end up with [Push 2, Push 3, +]. Which is almost correct, namely we need to swap the first n arguments + needs.
Also we need to consider what happens in a partial application case on a primitive function, I think due to inconsistent naming that it would not end too well.
We could try giving the primitive functions named arguments, then reordering them on the stack in the order of the named arguments (e.g. alphabetical with