There's of course also a optimized brainfuck compiler written in sed:
<a href="https://github.com/stedolan/bf.sed" rel="nofollow">https://github.com/stedolan/bf.sed</a>
I while ago I wrote a simple Brainfuck interpreter, JIT and compiler (<a href="https://github.com/brianquinlan/brainfuck-jit" rel="nofollow">https://github.com/brianquinlan/brainfuck-jit</a>).<p>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:
<a href="https://github.com/brianquinlan/brainfuck-jit/blob/master/bf_compile_and_go.cpp#L175" rel="nofollow">https://github.com/brianquinlan/brainfuck-jit/blob/master/bf...</a><p>and the function following it generates that table.
I have a (at the initial release, and possibly still) "state-of-the-art" Brainfuck compiler to C [1], which can compile a "Hello, world" program into a single `puts` call.<p>Some ProTip(tm): JITing Brainfuck doesn't fare a lot; for example, resetting the cell is an O(n) operation in BF, so JIT alone doesn't reduce this into O(1). Some kind of scalar evolution has to be implemented to reduce this O(n) factor. More sophiscated liveness and range analysis might be required to go further (esotope-bfc didn't get there, anyway).<p>[1] <a href="https://bitbucket.org/lifthrasiir/esotope-bfc" rel="nofollow">https://bitbucket.org/lifthrasiir/esotope-bfc</a>
<a href="http://calmerthanyouare.org/2014/09/30/brainfuck-java.html" rel="nofollow">http://calmerthanyouare.org/2014/09/30/brainfuck-java.html</a>
some of the issues encountered when writing a brainfuck-to-java compiler in brainfuck<p>Yo dawg, etc
Is there an implementation of this that converts any BF code into C/C# code? Might make a handy web-based tool.<p>It would be interesting to apply this to AI generated programs (<a href="http://www.primaryobjects.com/CMS/Article163" rel="nofollow">http://www.primaryobjects.com/CMS/Article163</a>)
Though rather juvenile I appreciated this interpreter that maps instructions to offensive four letter words.<p>NSFW text. ff/feckfeck/f* ckf* ck.<p><a href="http://web.archive.org/web/20050318095341/http://www.chilliwilli.co.uk/ff/" rel="nofollow">http://web.archive.org/web/20050318095341/http://www.chilliw...</a><p><a href="http://web.archive.org/web/20050311055852/http://www.chilliwilli.co.uk/ff/hwcommented.ff" rel="nofollow">http://web.archive.org/web/20050311055852/http://www.chilliw...</a>