You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, numbat doesn't return anything except the error message when encountering a runtime error:
% numbat -e "12 / 0"
error: runtime error
= Division by zero
Interpreter stopped
Ideally, it should return the line that caused the error (at least the line number and column).
Currently, this is not possible because once we generate the bytecode, we lose all information about the code source.
It seems like, in the industry, the way to make that work is to generate a second vector the sizes of the instructions that link to spans.
So while executing instructions we don't lose time with this information, but in case of an error we can find back what caused the issue.
I’m not an expert, if anyone know a better way to do it feel free to jump in!
The text was updated successfully, but these errors were encountered:
Or... maybe not so easy after all. Wouldn't that require stack traces as well?
fn f(x) = 1 / x
# 100 lines later
f(0)
The division by zero happens in an instruction that belongs to the code of f. But what would be more useful for the user would be to see the call site (one level up in the call stack) and it's corresponding span.
Currently, numbat doesn't return anything except the error message when encountering a runtime error:
Ideally, it should return the line that caused the error (at least the line number and column).
Currently, this is not possible because once we generate the bytecode, we lose all information about the code source.
It seems like, in the industry, the way to make that work is to generate a second vector the sizes of the instructions that link to spans.
So while executing instructions we don't lose time with this information, but in case of an error we can find back what caused the issue.
I’m not an expert, if anyone know a better way to do it feel free to jump in!
The text was updated successfully, but these errors were encountered: