pybfc - the optimizing brainfuck compiler
pybfc is a fast, optimizing brainfuck compiler. It takes brainfuck code, generates a parse tree and performs optimization with that tree, such as evaluating as much as possible at compile-time.
pybfc has many backends, which all generate code from the parse tree. It can also interpret code at a (very _very_) slow speed with the same engine that is used for optimizing code during compile time.
Things that work
- The folding optimizer.
- The dead code elimination optimizer.
- The C code generation backend.
- The Intel x86 Windows ABI code generation backend.
- The IAL code generation backend.
Things that don't
- The collapsing optimizer. It will work on any program that does not use the getchar operation, but may miscompile programs that do. Also extremely extremely slow (I dare you to try it on mandelbrot.b).
- The AT&T AMD64 System V ABI code generation backend.