Skip to content

Latest commit

 

History

History

wsbf

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

An interpreter for brainfuck, written in whitespace.

More specifically, the interpreter is written in an ASM-like language that compiles 1-to-1 into a Whitespace program. You can find the original source code in bf.wsasm. Compilation is handled by whitespace-rs, so if you have it installed, you can compile it as follows:

$ wsc -t -m -f asm bf.wsasm >bf.ws

The resulting program can be executed using the same tool:

$ wsc --unchecked-heap bf.ws

The program is read from STDIN until a ! character is encountered, after which all bytes will be considered input to the program.

$ echo '+++[->,+.<],.!foo' | wsc --unchecked-heap bf.ws
gpp

The version of BF simulated by this interpreter has an unbounded number of 8-bit cells to the right. Moving left of the starting cell doesn't work.