gnark is a fast zk-SNARK library that offers a high-level API to design circuits. The library is open source and developed under the Apache 2.0 license
at compile time we can detect some unsatisfiable constraint (like api.AssertIsEqual(2, 4) ) and panic.
we add the unsatisfiable constraint, and wait until we solve the constraint system to throw the error.
And I think it generalize well into "how much do we want to assist the circuit developer";
Has the advantage to be more dev-friendly; catching mistakes like this early on makes for a better dev workflow.
is cleaner and gets us better testability (same code paths everywhere, etc). it also allows for things like SMT solver integration (where we may want to add "unsolvable constraint" and ensure that indeed, the whole system is unsolvable; that is detect bugs in the compiler).
We could log potential errors early on, but we lose the "cleaner" part of 2 (we will have in each api to implement this warnings anyway).
I think we will still test for constants in many places; for example;
api.AssertIsEqual(3,2) --> should we really add in the constraint system a constraint that says "(3-2) == 0" ?
see for example #552 ;
We can have 2 strategies;
api.AssertIsEqual(2, 4)
) andpanic
.And I think it generalize well into "how much do we want to assist the circuit developer";
We could log potential errors early on, but we lose the "cleaner" part of 2 (we will have in each api to implement this warnings anyway).