Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A Brainfuck compiler targeting multiple backends.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 libpybfc
Octocat-spinner-32 tests
Octocat-spinner-32 .gitignore
Octocat-spinner-32 CREDITS
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.rst
Octocat-spinner-32 pybfc
Octocat-spinner-32 pybfc.bat
README.rst

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.
Something went wrong with that request. Please try again.