snarkVM icon indicating copy to clipboard operation
snarkVM copied to clipboard

[Feature] Support `ternary` over composite data types.

Open d0cd opened this issue 2 months ago • 0 comments

🚀 Feature

The AVM only supports ternary operations on LiteralTypes. In Leo, when a ternary operation is performed over a 1-D array, the compiler rewrites it into N ternaries over each of the elements and a cast to aggregate the result.

By supporting this in the AVM we can:

  • reduce the amount of bytecode generated, enabling programs that would have otherwise exceeded the program size limit.
  • make AVM bytecode generated by Leo easier to audit.

d0cd avatar Oct 27 '25 13:10 d0cd