convention for functions that don't assert the result?
Interestingly in ocaml there's a convention that if your function can raise an exception then it should have _exn at the end (e.g. https://ocaml.janestreet.com/ocaml-core/109.20.00/doc/core/List.html)
Rust sort of had a convention that you should document any function that could panic.
In both cases this was never really asserted by the compiler and so wasn't too useful. But I think these are good ideas.
I'm wondering if it would make sense to have a convention in function naming to distinguish functions that assert the result, or don't assert the result. For example assert_equal asserts that two variables are equal and equal returns a boolean.
Can we maybe also include the constraint generating functions in the convention? Like not only assert_equal may raise an exception, it also generates a constraint. I was super confused when circom doesn't create a constraint using assert for instance. This kind of convention could signal that beforehand clearly.
I don't think so because IMO it's a leaky abstraction, the user shouldn't care about what creates or doesn't create constraints. The fact that circom doesn't constrain anything on assert() is a bad language design