News for hackers. Stuff that matters.
Re:Brainfuck Optimization Strategies by bquinlan on Wednesday January 07, 2015 @11:40AM (#8851487)
I while ago I wrote a simple Brainfuck interpreter, JIT and compiler (https://github.com/brianquinlan/brainfuck-jit).

The compiler implements the "Operation offsets" optimization as described in the article. It is actually pretty straightforward. This function converts a map of offset => delta to x86-64 instructions: https://github.com/brianquinlan/brainfuck-jit/blob/master/bf...

and the function following it generates that table.

Re:Brainfuck Optimization Strategies by icefox on Wednesday January 07, 2015 @12:07PM (#8851679)
A silly Brainfuck interpreter I wrote one evening converts BF to JavaScript and runs eval() on it. The result was that I got for free all of the compiler optimizations and JIT capabilities in the Javascript engines for a trivial amount of effort. I found the resulting execution faster than the various hand rolled C interpreters I found online. The best part was that I spent probably less than an hour implementing and testing my "interpreter".