wsf
Brainfuck in whitespace: every command is a pair of spaces, tabs and newlines.
Turing complete: yes · ●●○ moderate
Tested with 3 known programs · Hello World on Try It Online: identical · Test method
Run it
The idea
wsf writes brainfuck with the three characters that most editors do not show. Two of them make one command, which gives nine pairs for eight commands. A program looks like an empty file, the way a Whitespace program does, and any visible text around it is a comment.
Read the story
There is no page for it on esolangs.org. The table is read off the hello world TIO runs, and it prints exactly what TIO printed. Read as a grid, it is tidy: the pairs that start with a space are + - >, those that start with a tab < ., those that start with a newline [ ]. The two pairs that program never uses, tab newline and newline newline, are left out; one of them is presumably input.
The machine
A tape of byte cells that wrap at 256, growing both ways, and a pointer.
| then space | then tab | then newline | |
|---|---|---|---|
| space | + | - | > |
| tab | < | . | not known |
| newline | [ | ] | not known |
Example
In brainfuck this is ++++++++[>++++++++<-]>+., which prints 65, A.
In brainfuck this is ++++++++[>++++++++<-]>+., which prints 65, A.
Patterns it teaches
- Camouflage: a program that is invisible in the specification.
- Encoding tricks: three symbols in pairs give nine codes.
Further
- TIO's interpreter: github.com/dkudriavtsev/wsf
See also
Also in Camouflage
Write your own in Run Convert a program from wsf
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: wsf.
Command line
shib run wsf -e '
'shib manual wsfSource
- Module
langs/tio/ports.js- Interpreter
langs/tio/wsf.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language