8000 GitHub - s3rius/brainbreak: BrainFuck REPL, Interpreter and compiler.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

s3rius/brainbreak

Repository files navigation

Coverage Status GitHub Workflow Status Haskell version

brainBreak

Simple BrainFuck toolkit written in haskell.

This project covers 3 things:

You can check it by yourself.

Instalation

You need to install Stack before continue. Since you've got the Stack, you can simply install this project by running:

git clone https://github.com/s3rius/brainbreak.git
cd brainbreak
stack install

Additionally for compilation you need to have different compilers installed. For C++ compilation you need to install clang++.

REPL

asciicast You can just call bb to enter REPL. It works as ipython. Every time you hit the Enter button, code evaluates. It's simple as is.

REPL itself inspired by the IPython project and looks similar to it. Addition commands:

In [0]: ++++

# Print current REPL state.
In [1]: :state
Current index: 0
Offset from start: 0
part of curren buffer:
[0,0,0,0,0,4,0,0,0,0,0]

# Print current buffer as list of integers.
In [2]: :buf
[0,0,0,0,0,4,0,0,0,0,0]

# Print current buffer as characters.
In [3]: :bufc
"\NUL\NUL\NUL\NUL\NUL\EOT\NUL\NUL\NUL\NUL\NUL"

Interpreter

asciicast To run brainbreak as interpreter you need to provide a brainFuck file.

bb -i /path/to/file.bf

This command will optimize and evaluate the code from file.

Compiler

asciicast To compile your bf files you need to provide input and output files. The backend option can be omitted.

bb -i /path/to/input.bf -o /path/to/output

# If you want to change compilation backend you can add option
bb -i /path/to/input.bf -o /path/to/output -b Cpp

About

BrainFuck REPL, Interpreter and compiler.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  
0