This repository has been archived by the owner on Apr 9, 2024. It is now read-only.
Define a "Brillig stdlib" for common functions for easier display #471
Labels
enhancement
New feature or request
Problem
Noir is currently replacing the usage of a number of directives with Brillig functions.
The example Noir program
currently gets displayed as
What was once
DIR::INVERT (_3, out: _4)
is nowBRILLIG: inputs: [Single(Expression { mul_terms: [], linear_combinations: [(1, Witness(3))], q_c: 0 })] outputs: [Simple(Witness(4))] [JumpIfNot { condition: RegisterIndex(0), location: 3 }, Const { destination: RegisterIndex(1), value: Value { inner: 1 } }, BinaryFieldOp { destination: RegisterIndex(0), op: Div, lhs: RegisterIndex(1), rhs: RegisterIndex(0) }, Stop]
This makes it much harder to read ACIR code while debugging as the user needs to verify that this brillig bytecode is correct.
Happy Case
We should define a set of standard brillig functions such as inversion, quotient, etc. here in ACVM. When displaying brillig opcodes we can then hash the bytecode to compare against this known list of brillig functions. We can then display a human readable format similarly to what we do for the
Directive
opcodes.Alternatives Considered
No response
Additional Context
No response
Would you like to submit a PR for this Issue?
Yes
Support Needs
No response
The text was updated successfully, but these errors were encountered: