esolang

LETTER

Brainfuck as a letter. It opens with Dear, Reader, signs off with Love, Programer, and every sentence in between is a command.

A(), 2025 · Turing complete: yes · ●○○ easy · esolangs.org

Tested with 2 known programs · Test method

Run it

Expected: aa

The idea

A() made LETTER in 2025, a copy of brainfuck that reads like a letter. Each of the eight commands is a stock sentence, such as "So hello!" to open a loop and "Well, that's that." to print. The spelling is the specification's own, "parhaps" and "Unpleasent" included, and a program has to use it exactly.

The machine

The machine is brainfuck's, a tape of byte cells and a pointer.

SentencebrainfuckDoes
Very great news!+Add 1 to the cell
Unpleasent news.-Subtract 1
You might thinking,>Move right
But,<Move left
I would like to hear from you!,Read a byte
Well, that's that..Print the cell
So hello![Skip the loop if the cell is 0
Let's move on parhaps?]Repeat while the cell is not 0

Cells wrap from 255 to 0, and a read at the end of the input gives 0.

Example

Read a character and print it twice.

Read a character and print it twice.

The truth machine from the specification is ,.[-->+[>>]<[.]<<] in brainfuck. It prints what it reads and then takes 2 from it in a loop. The character 0 is the byte 48, so the loop ends after 24 rounds.

Expected: 0

On 1 the byte is 49, which is odd and never reaches 0. The second cell counts the rounds, and after 256 of them it wraps to 0. From then on the inner loop prints 1 forever.

The cat, ,.[,.] in brainfuck, stops only because a read at the end of the input gives 0, and it prints that 0 byte as well.

Patterns it teaches

  • Camouflage: the program looks like a short, polite letter.
  • Turing tarpit: brainfuck's eight commands, spelled as sentences.

Further

LETTER builds on Brainfuck.

Brainfuck derivatives

Cell-based

Write your own in Run Convert a program from LETTER

Implementation

JavaScript interpreter, source and command line

A JavaScript interpreter, used in the browser and on the command line. Id: letter.

Command line

shib run letter -e 'Dear, Reader
I would like to hear from you!
Well, that'\''s that.
So hello!
I would like to hear from you!
Well, that'\''s that.
Let'\''s move on parhaps?
Love, Programer' --input 'hi'
shib manual letter

Source

Module
langs/wiki/ports.js
Interpreter
langs/wiki/letter.js

Docs: Kernel instructions · The .shib format · Command line · Adding a language

Source esolangs.org (CC0) · Edit on esolangs.org