Jump Instructions in VM

At the time of writing, the following is written in the Public VM Architecture page in the documentation.

Q: Do we want to support JUMP/JUMPI instructions for public ACIR++ functions? Would be very nice to have but creates discontinuity between public/private functions.

Can this be expanded here? How does it create discontinuity between public and private functions?

28 Likes

Thanks for posting :slight_smile:

Private functions are compiled into circuits, so they can’t have jump instructions (if you have an if statement in a circuit, both ‘branches’ of the statement get executed; there’s no “jump”). Public functions, on the other hand, are compiled to opcodes, and those opcodes are then ‘executed’ in a VM circuit. So for public functions, we can have more traditional (non-circuit) opcodes.

33 Likes