In our [JavaScript prototype](https://github.com/BitVM/bitvm-js/blob/main/scripts/compile.js#L25) we had automatic code optimizations for simple patters, e.g. replace `1 OP_ROLL` with `OP_SWAP`. We should implement that again.