[NO TESTS] WIP
This commit is contained in:
parent
b241e6e0b4
commit
93f5c7bc24
1 changed files with 8 additions and 4 deletions
|
@ -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.
|
||||||
|
|
Loading…
Reference in a new issue