Value::Hint allows us to write more complex functions when computing out-of-circuit in the compiler. But it is annoying because we can't easily serialize these functions.
For example, we might want to write a js (or rust-wasm) interpret that generates the witness based on a list of Values. So that one can use their browser to generate witnesses, for example. The usage of closures in Value::Hint makes that hard.
I think what we could do is have another enum inside of Hint which list all of the possible functions that we're implementing as more complex functions. Or we could also inline all of the possible hint functions within the Value enum.
Value::Hint
allows us to write more complex functions when computing out-of-circuit in the compiler. But it is annoying because we can't easily serialize these functions.For example, we might want to write a js (or rust-wasm) interpret that generates the witness based on a list of
Value
s. So that one can use their browser to generate witnesses, for example. The usage of closures inValue::Hint
makes that hard.I think what we could do is have another enum inside of
Hint
which list all of the possible functions that we're implementing as more complex functions. Or we could also inline all of the possible hint functions within theValue
enum.