a brainfuck just-in-time compiler written in python with llvmlite
This simple program does the following:
- parse a brainfuck source file
- build an llvm ir representation of the program and prints it
- optimize said llvm ir and prints it
- runs it as machine code
- python
- llvmlite
python bf.py mandelbrot.bf
very helpful resources:
- Building and using llvmlite - a basic example
- [llvm-brainfuck] (https://github.com/jeremyroman/llvm-brainfuck) (c++ implementation)
- pykaleidoscope (official tutorial rewritten with llvmlite)