Example:
import brainfuck, streams
interpret("++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.")
# Prints "Hello"
proc mandelbrot = compileFile("examples/mandelbrot.b")
mandelbrot() # Draws a mandelbrot set in ASCIi
This is a toy interpreter for the brainfuck programming language written fully in Nim. It doubles as a transpiler of brainfuck into efficient Nim code.
This is a toy project made to get my feet wet with nim, as a first experience with the language. If you have any suggestions regarding the source code, feel free to open an issue.
- install nim
git clone https://github.com/xlxs4/nim-brainfuck-interpreter.git
cd nim-brainfuck-interpreter/
nimble build
After that you will get a ready-made binary file in the root directory of the project.