An instruction's execute function now returns a Result. This allows us to indicate failure in instruction execution. Currently the only failing instructions are . and , which read and write to IO, which is not reliable.
This feature allows for other improvements as well. For example the wrapping logic from #2 can now be handled correctly, allowing for wrapping errors to be detected at runtime. This PR will need to be updated.
Last the type of the result is Result<(), Error> at the moment, but we could change it in the future to be Result<Snapshot, Error> for collecting a snapshot of the interpreter state. This is most useful for profiling as requested in #9.
An instruction's
execute
function now returns aResult
. This allows us to indicate failure in instruction execution. Currently the only failing instructions are.
and,
which read and write to IO, which is not reliable.This feature allows for other improvements as well. For example the wrapping logic from #2 can now be handled correctly, allowing for wrapping errors to be detected at runtime. This PR will need to be updated.
Last the type of the result is
Result<(), Error>
at the moment, but we could change it in the future to beResult<Snapshot, Error>
for collecting a snapshot of the interpreter state. This is most useful for profiling as requested in #9.