Improve ergonomics of failing instruction assert
and assert_vector
#324
Labels
🧑💻 dx/ux
Developer experience & user experience
💫 good first issue
Good for newcomers
🟢 prio: low
Not at all urgent
🛠️ tooling
Developer tools
When Triton VM tries to execute instruction
assert
while the top of its stack is unequal to 1, it fails. Currently, the error it returns does not give any further context. It would be beneficial for developers writing Triton assembly if instructionassert
could be decorated with some context, indicating which of potentially manyassert
statements failed, and potentially also why it failed.One idea would be to allow specifying an error code:
Another possibility is to be more explicit about the failure reason:
User-provided context should be optional. That is, the following program should remain syntactically correct (even though it will not halt successfully):
Note that all syntax examples are simply first drafts of suggestions and should be designed properly.
The text was updated successfully, but these errors were encountered: