zksecurity / noname

Noname: a programming language to write zkapps
https://zksecurity.github.io/noname/
178 stars 44 forks source link

Can we remove `Value::Hint`? #38

Open mimoo opened 4 months ago

mimoo commented 4 months ago

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.

mimoo commented 4 months ago

(this would allow us to remove the type parameter on the backend)