Skip to content
No description, website, or topics provided.
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.


Type Name Latest commit message Commit time
Failed to load latest commit information.


qmbfc is a brainfuck compiler written in the Myrddin programming language. qmbfc emits QBE intermediate assembly, which is then translated to x86_64 assembly via the qbe backend executable.


This is a port of qmbfc which emits llvm IR contributed by Quentin Carbonneaux (The author of qbe). It serves as a good comparison of the minimum essentials of emitting llvm or qbe IR directly as text.


(Only tested on linux)

Install myrddin from source and then run in the project directory:

$ mbld

You should then have two binaries ./qmbfc and ./lmbfc corresponding to the qbe and llvm versions of the binary.

Running the compilers

You must have llvm and qbe to run either version of the compiler.

For example, to execute the qbe version and run the compiled binary.

./qmbfc < examples/ > mandlebrot.ssa && qbe < mandlebrot.ssa > mandlebrot.s && gcc mandlebrot.s && ./a.out

To execute the llvm version and run the compiled binary.

./lmbfc < examples/ > mandlebrot.llvm && llc < mandlebrot.llvm > mandlebrot.s && clang mandlebrot.s && ./a.out


You can’t perform that action at this time.