[NO TESTS] WIP

This commit is contained in:
Reid 'arrdem' McKenzie 2022-08-13 00:03:49 -06:00
parent 82e4cc5c7f
commit 3533471567

View file

@ -1,10 +1,13 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
"""The Ichor VM.interpreterementation. """The Ichor VM implementation.
The whole point of Shoggoth is that program executions are checkpointable and restartable. This requires that rather than The whole point of Shoggoth is that program executions are checkpointable and restartable. Unfortunately it's difficult
using a traditional recursive interpreter which is difficult to snapshot, interpretation in shoggoth occur within a to implement such snapshotting and introspection using a traditional recursive evaluator. It is however VERY easy to
context (a virtual machine) which DOES have an easily introspected and serialized representation. bolt those capabilities onto a VM in a meaninful way. Just provide ways to break, pause or single-step the interpreter
and capture the resulting state(s).
The VM provides exactly these capabilities, along with some niceties for extensible error recovery and introspection.
""" """
@ -90,6 +93,7 @@ class BaseInterpreter(object):
# "return" via raising InterpreterRestart if that's the desired behavior. Otherwise it's too easy to put the # "return" via raising InterpreterRestart if that's the desired behavior. Otherwise it's too easy to put the
# interpreter into screwy states where an instruction is half-executed and we want to resume execution at that # interpreter into screwy states where an instruction is half-executed and we want to resume execution at that
# fine-grained undefined point. # fine-grained undefined point.
"""Handler for interpreter errors. """Handler for interpreter errors.
Called when the interpreter encounters an illegal or incorrect state. Called when the interpreter encounters an illegal or incorrect state.