Skip to content

How to clear vm state? #625

Answered by sharkdp
kernelsoe asked this question in Q&A
Oct 18, 2024 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

I'm afraid this is not possible at the moment. What we do in the web-version is to replace the whole interpreter (

numbat = create_numbat_instance();
). Something similar should also be possible in Rust.

You could cache/store the context after the prelude has been loaded, but before any user input has been evaluated. Whenever you want to reset, you go back to that cached state of the context. We do something similar in the unit tests, and it was a massive speed up for the test suite.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@kernelsoe
Comment options

@sharkdp
Comment options

Answer selected by kernelsoe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants