noname icon indicating copy to clipboard operation
noname copied to clipboard

document how match_expected is different from same_as

Open mimoo opened this issue 1 year ago • 2 comments

we have two functions:

  • match_expected
  • same_as

and they seem to be doing the same thing, almost. There's no documentation and I don't remember why I wrote them like this. It would be helpful if someone can investigate why we have two functions here, and either merge them into one or document why we need two different functions

mimoo avatar Aug 23 '24 18:08 mimoo

Hi @mimoo , this is my first issue on Noname so I may have some misunderstandings about the code.

From my understanding these are the differences:

match_expected: Allows for flexible matching between types, meaning it considers types equivalent in certain contexts, such as treating BigInt as equivalent to Field.

same_as: Requires an exact match between types, ensuring that two types are completely identical.

Should I try and use one of the 2 functions, or add docs that explains the difference?

ronantakizawa avatar Aug 25 '24 12:08 ronantakizawa

Hey! So what we're wondering is how is that difference used? Why is one called over another? (Like who calls the first one, who calls the second one)

Especially after this PR: https://github.com/zksecurity/noname/pull/164

I think a PR merging both of the functionality with some documentation and a new argument flag that allows switching between the two behaviors would be nice!

mimoo avatar Aug 26 '24 14:08 mimoo