Michael is a user on octodon.social. You can follow them or interact with them if you have an account anywhere in the fediverse. If you don't, you can sign up here.

got exceptions working along with my weird idea for clearing the operand stack 🤓 hastebin.com/oqalutefuz.js

Since my language is all expressions I can't just clear the entire operand stack like you'd see in the openjdk, coreclr, and mono interpreters

python seems to use frames for everything, and I wanted to see if I could do this without pushing protected-block frames

To accomplish this, when an exception is thrown my clear_op_stack routine scans bytecode until it sees a ProtectedJump (marks the end of a catch or try, similar to MSIL's CEE_LEAVE_S), along the way it keeps track of stack effects and applies them at the end. so that way you get however may POPs you'd expect if the exception weren't thrown

Michael @drjeats

(I guess I should link these toots into )

· Web · 0 · 0