jonasforth icon indicating copy to clipboard operation
jonasforth copied to clipboard

Not dying completly when anything goes wrong would be nice.

Open lolbinarycat opened this issue 4 years ago • 1 comments

specifically, parse_number calls os_terminate if it fails, which is really annoying if you are running on actual hardware. short of rewriting everything to propogate errors, couldn't you just jump somewhere that would start the interpret loop again?

lolbinarycat avatar Feb 28 '21 22:02 lolbinarycat

Yeah, I agree that this is really annoying. Even when just testing in the emulator, it's been bothering me for a while.

It's been a while since I've worked on this project, and I don't necessarily want to dive back into it just for this. With that being said, I'd be happy to take a look at a pull request if you or anyone else wants to try to make a fix. No pressure :)

If I recall correctly, the main reason that I didn't do this was that getting the stack into a correct state after giving up from parse_number would be non-trivial (because we're already several words deep by that point). But to be honest, I only half-remember the code, so maybe it's not as complicated as I think.

Just resetting everything and returning to the top-level interpret loop may be an acceptable workaround, as you suggest.

c2d7fa avatar Mar 02 '21 19:03 c2d7fa