Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add proper error handling/unwinding #37

Open
darrylabbate opened this issue Nov 14, 2022 · 0 comments
Open

Add proper error handling/unwinding #37

darrylabbate opened this issue Nov 14, 2022 · 0 comments
Labels
feature New feature or request implementation General implementation of the interpreter

Comments

@darrylabbate
Copy link
Member

darrylabbate commented Nov 14, 2022

The interpreter currently prints some message to stderr and immediately exits whenever a given error is encountered. There needs to be a more robust system in place s.t. various callers can properly unwind.

This will be a little tricky wrt the VM, especially builtin functions. I'd rather not have the VM check the return status every time a C function is called. It probably makes more sense to pass the global riff_state struct around (similar to Lua). That way errors can continue to be directly thrown from anywhere in the interpreter, and some dedicated error handler (state.c?) can do any necessary unwinding.

@darrylabbate darrylabbate added feature New feature or request implementation General implementation of the interpreter labels Nov 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request implementation General implementation of the interpreter
Projects
None yet
Development

No branches or pull requests

1 participant