nixpulvis / brainfuck

A simple brainfuck interpreter in Rust.
http://nixpulvis.com/brainfuck
23 stars 3 forks source link

Failing Instructions #10

Closed nixpulvis closed 8 years ago

nixpulvis commented 8 years ago

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.

nixpulvis commented 8 years ago

Need this now.