Everything related to the Brainfuck language
- What is brainfuck
- Features
- Usage
- Issues
- Initial Goal for the interpreter in C
- Goals
- Web Interpreter
- References
Brainfuck is a esoteric language that is turing complete so theoretically anything that a turing machine can compute can be computed in brainfuck. It's distinguishing feature ks that it only uses eight symbols for instructions (and ignores rest) to do anything achievable (given infinite time and memory).
- the size of the tape is taken
30000in general - the program terminates if tape cell
-1or30001is tried to access - each cell is
1 bytein size storing from0 to 255 - incrementing
255gives0 - decrementing
0gives255(making a full circle)
+- increment the value of current cell by 1-- decrement the value of current cell by 1>- shifts the memory pointer to right by one<- shifts the memory pointer to left by one[- jump to the next corresponding]if value at current cell is zero]- jump to the next corresponding[if value at current cell is non zero.- output the value of current cell in ASCII,- take one byte input from user and store as integer
- execute a file via
brainfuck <file>- enter interactive mode (REPL) via
brainfuck- gives helpful errors
- Error: Couldn't open file:
<file> - Error: Maximum tape length exceeded
- Error: Tried to access negative tape cell
- Error: Couldn't find corresponding
[ - Error: Couldn't find corresponding
]
- Error: Couldn't open file:
- access the binaries in the release section
- Execute from a file
brainfuck <file>- Interactive shell (REPL mode)
brainfuck- Help menu
brainfuck -h
#or
brainfuck --help- Version number
brainfuck -v
#or
brainfuck --version- About author
brainfuck --about- Anything else shows the usage menu
- currently user can't input newline
\nintentionally at both,command and REPL - command length is hardcoded at 50KB
- REPL prompt gets cut off at space character due to
%sscanf behaviour of C - loops spanning multiple REPL prompts isn't possible (probably won't implement)
- Brainfuck interpreter in C ✅
- Brainfuck interpreter for the web in JavaScript ⏳
- Brainfuck example programs
(Either code myself or make a program to do that)
- Add / subtract
- other algorithms like sum/factorial (Not even sure how would I approach that)
- Brainfuck compiler in C
- Brainfuck interpreter in Brainfuck
- Brainfuck explainer/debugger
- Brainfuck targeting transpiler
- Brainfuck compiler in Assembly (The last chad move) 😂😂
- Brainfuck in logic gates 💥
- a functioning terminal
- proper character input (mobile support)
- backspace, other better keyboard support
- the actual interpreter
- binding the terminal and interpreter