Brainfuck x86 Compiler

Jul. 31, 2009
comments

This optimizing brainfuck compiler is written in python using pyasm to produce x86 executable (elf) binaries.

Features

  • Run produced code immediatly
  • Compile to an elf binary
  • Optimizes for brainfuck patterns

Download

Dependencies

Install

brainfuck is a python package installable by any of the following commands:

cd brainfuck; python setup.py install
easy_install brainfuck

Usage

bfc [--no-optimize] [-type repeat,loop] [-o OUTFILE] INFILE

Example

>++++++++++>+>+[
    [+++++[>++++++++<-]>.<++++++[>--------<-]+<<<]>.>>[
        [-]<[>+<-]>>[<<+>+>-]<[>+<-[>+<-[>+<-[>+<-[>+<-[>+<-
            [>+<-[>+<-[>+<-[>[-]>+>+<<<-[>+<-]]]]]]]]]]]+>>>
    ]<<<
]

FAQ

„Does bfc run with 64 bit?“
DasIc

No

License

GNU AGPLv3 or later, Copyright 2008 Florian Bösch