nixpulvis / brainfuck

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

Compress Code on Initialization #7

Closed nixpulvis closed 8 years ago

nixpulvis commented 8 years ago

When you create a new interpreter we should strip all unused bytes. This could be done elegantly by implementing Into<String> for the interpreter's code. This means we want a new structure for the code, which is actually already something we wanted to allow abstracting over the syntax if needed.

An easy first step would be implementing Into<char> for Instruction.

nixpulvis commented 8 years ago

@mossberg This is probably going to look a bit like your bracket cache. Hopefully this will clean up the implementations of skip forward and skip backward.

nixpulvis commented 8 years ago

See #12 for where to start.

nixpulvis commented 8 years ago

Fixed by #14