Skip to content

A toy brainfuck interpreter and transpiler written in the Nim programming language

License

Notifications You must be signed in to change notification settings

xlxs4/nim-brainfuck-interpreter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xlxs4 xlxs4 xlxs4


Example:

import brainfuck, streams

interpret("++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.")
# Prints "Hello"

proc mandelbrot = compileFile("examples/mandelbrot.b")
mandelbrot() # Draws a mandelbrot set in ASCIi

Description

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.

Building

  1. install nim
  2. git clone https://github.com/xlxs4/nim-brainfuck-interpreter.git
  3. cd nim-brainfuck-interpreter/
  4. nimble build

After that you will get a ready-made binary file in the root directory of the project.

👉 Visit the documentation page for more: https://xlxs4.github.io/nim-brainfuck-interpreter/