[→] brainfuck/ chat lab

NO CODING EXPERIENCE NEEDED

A chat app built with the Brainfuck programming language

Learn how its eight commands work, then invite someone to chat.

01

FIRST, MAKE SOMETHING HAPPEN

Send your first message.

You control both sides: Alice sends, Bob receives.

PRACTICE CHAT
Only you can see this practice conversation.You control Alice and Bob on this device.
Watch the green highlight when it arrives.
Try both sides of the conversationALICE ↔ BOB
A
AliceYou can type here
→Be Alice. Say hello.

Type here, or use the hello button.

0/120 bytesEnter to send
B
BobYou can reply here
←Bob’s inbox is ready.

Alice’s message arrives here.

0/120 bytesEnter to send
AliceBrainfuck serverBobClick a message to inspect
Try a message
WHAT JUST HAPPENED?Send → deliver → confirm

A little tour of the delivery route.

Client = chat window. Server = message delivery.

Next: what do those symbols mean?
02

YOUR FIRST TINY PROGRAM

You only need eight symbols.

Brainfuck stores numbers in memory cells, shown as boxes below. Its commands change those numbers, move between cells, and read or output characters.

Meet the whole language.

Tap a symbol to meet it.

+

Add one

Add 1 to the current box. 64 becomes 65.

See commands work together

Choose an example to run it.

box 165box 20

64 becomes 65, and 65 prints as A.

Output: A

The chat uses these same patterns.

TINY CHALLENGE 1 OF 3123

Make the computer say A.

The first box starts at 64. A is 65. Add one, then say it. Tap commands below.

YOUR PLAN
  1. Change 64 into 65.
  2. Print the selected box as a letter.
box 164↑ selected cell
box 20
box 30
box 40
box 50
box 60
box 70
box 80
YOUR PROGRAMtap a symbol above
THE COMPUTER SAYS…
Free play: add your own commands

Continue from the highlighted box and the numbers above. Type only the next commands you want to run. For example, +. adds one to the selected box and prints it.

These commands are added to your program, so the run continues from the state shown above. “Start over” resets box 1 to 64. This uses the same interpreter as the chat.

03

TRY IT TOGETHER

Chat with someone on another device.

Create a room and share its link. The other person can join from a phone or computer.

Brainfuck processes the messages. The website handles the connection between devices.

Rooms are for two people. Share the invitation only with the person you want to chat with.

A person on a laptop exchanging messages with someone using a phone

FOR THE CURIOUS

What did we actually build?

A client for each person and a shared server
Alice’s window
Brainfuck client
Shared server
Brainfuck server
Bob’s window
Brainfuck client

The Brainfuck programs process messages and delivery confirmations. A TypeScript interpreter executes the .bf instructions and the website connects the devices. No Python runs this chat.

Explore or download the code
.bf

Client program

client.bf

Processes incoming messages and delivery confirmations for each participant.

Download client.bf
View client.bf
,>,>,>,>>[-]>>>>>>>[-]>[-]<<<<<<<<<<<<<[->>>>>>>>>>>>+>+<<<<<<<<<<<<<]>>>>>>>>>>>>>[-<<<<<<<<<<<<<+>>>>>>>>>>>>>]<->[-]>>[-]<<<[->+>>+<<<]>>>[-<<<+>>>]<[-]+<[[-]>[-]<]>[[-]<<<<<<<<<[-]+>>>>>>>>>]<<[-]>[-]<<<<<<<<<<<<<[->>>>>>>>>>>>+>+<<<<<<<<<<<<<]>>>>>>>>>>>>>[-<<<<<<<<<<<<<+>>>>>>>>>>>>>]<-->[-]>>[-]<<<[->+>>+<<<]>>>[-<<<+>>>]<[-]+<[[-]>[-]<]>[[-]<<<<<<<<<[-]+>>>>>>>>>]<<[-]>[-]>[-]<<<<<<<<<<<<<[->>>>>>>>>>>>+>+<<<<<<<<<<<<<]>>>>>>>>>>>>>[-<<<<<<<<<<<<<+>>>>>>>>>>>>>]<->[-]>>[-]<<<[->+>>+<<<]>>>[-<<<+>>>]<[-]+<[[-]>[-]<]>[[-]<<<[-]+>>>]<<[-]>[-]<<<<<<<<<<<<<[->>>>>>>>>>>>+>+<<<<<<<<<<<<<]>>>>>>>>>>>>>[-<<<<<<<<<<<<<+>>>>>>>>>>>>>]<-->[-]>>[-]<<<[->+>>+<<<]>>>[-<<<+>>>]<[-]+<[[-]>[-]<]>[[-]<<<[-]+>>>]<<[-]>[-]<<<<<<<<<<<<<[->>>>>>>>>>>>+>+<<<<<<<<<<<<<]>>>>>>>>>>>>>[-<<<<<<<<<<<<<+>>>>>>>>>>>>>]<--->[-]>>[-]<<<[->+>>+<<<]>>>[-<<<+>>>]<[-]+<[[-]>[-]<]>[[-]<<<[-]+>>>]<<[-]>[-]<<<<<<<<<<<<<[->>>>>>>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>>>>>>[-<<<<<<<<<<<<<<<<<<<+>>>>>>>>>>>>>>>>>>>]<-->[-]>>[-]<<<[->+>>+<<<]>>>[-<<<+>>>]<[-]+<[[-]>[-]<]>[[-]<<<<<<<<<<<<<<<<<.>>>[-]++.<<<<<.>>>>>[-].>>>>>>>>>>>>>>]<<[-]>[-]<<<<<<<<<<<<<<<<<<<[->>>>>>>>>>>>>>>>>>+>+<<<<<<<<<<<<<<<<<<<]>>>>>>>>>>>>>>>>>>>[-<<<<<<<<<<<<<<<<<<<+>>>>>>>>>>>>>>>>>>>]<---->[-]>>[-]<<<[->+>>+<<<]>>>[-<<<+>>>]<[-]+<[[-]>[-]<]>[[-]<<<<<<<<<<<<<<<<<.>>>[-]++++.<<<<<.>>>>>[-].>>>>>>>>>>>>>>]<<[-]>[-]<<<<<<<<<<<<<<<<<<<[->>>>>>>>>>>>>>>>>>+>+<<<<<<<<<<<<<<<<<<<]>>>>>>>>>>>>>>>>>>>[-<<<<<<<<<<<<<<<<<<<+>>>>>>>>>>>>>>>>>>>]<----->[-]>>[-]<<<[->+>>+<<<]>>>[-<<<+>>>]<[-]+<[[-]>[-]<]>[[-]<<<<<<<<<<<<<<<<<.>>>[-]+++++.<<<<<.>>>>>[-].>>>>>>>>>>>>>>]<<<]<<<][-]>>[-]<<<<<<<<<<<<[->>>>>>>>>>+>>+<<<<<<<<<<<<]>>>>>>>>>>>>[-<<<<<<<<<<<<+>>>>>>>>>>>>]<[-]+<[[-]>[-]<]>[[-]<<<<<<<<<<<<[-]+++.>>>[-]++++.<<<<<.>>>>>[-].>>>>>>>>>]
.bf

Server program

server.bf

Checks messages and directs them to the other participant.

Download server.bf
View server.bf
,>,>,>,>>[-]>>>>>>>[-]>[-]<<<<<<<<<<<<<[->>>>>>>>>>>>+>+<<<<<<<<<<<<<]>>>>>>>>>>>>>[-<<<<<<<<<<<<<+>>>>>>>>>>>>>]<->[-]>>[-]<<<[->+>>+<<<]>>>[-<<<+>>>]<[-]+<[[-]>[-]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[-]>>[-]<<<[->+>>+<<<]>>>[-<<<+>>>]<[-]+<[[-]>[-]<]>[[-]<<<<<<<<<<<<<<<.>>>[-]++.<<<<<.>>>>>[-].>>>>>>>>>>>>]<<<<][-]>[-]<<<<<<<<<<<[->>>>>>>>>>+>+<<<<<<<<<<<]>>>>>>>>>>>[-<<<<<<<<<<<+>>>>>>>>>>>]<[[-]>[-]>[-]<<<<<<<<<<<<<<<<[->>>>>>>>>>>>>>>+>+<<<<<<<<<<<<<<<<]>>>>>>>>>>>>>>>>[-<<<<<<<<<<<<<<<<+>>>>>>>>>>>>>>>>]<--->[-]>>[-]<<<[->+>>+<<<]>>>[-<<<+>>>]<[-]+<[[-]>[-]<]>[[-]<<<<<<<<<<<<<<<<<<.>>>>>>>[-]+++++.<<<<<.>>>>>[-].>>>>>>>>>>>]<<<][-]>>[-]<<<<<<<<<<<<[->>>>>>>>>>+>>+<<<<<<<<<<<<]>>>>>>>>>>>>[-<<<<<<<<<<<<+>>>>>>>>>>>>]<[-]+<[[-]>[-]<]>[[-]<<<<<<<<<<<<[-]+>>>>>>>>>>>>>[-]>[-]<<<<<<<<<<<<<<<<<<[->>>>>>>>>>>>>>>>>+>+<<<<<<<<<<<<<<<<<<]>>>>>>>>>>>>>>>>>>[-<<<<<<<<<<<<<<<<<<+>>>>>>>>>>>>>>>>>>]<-->[-]>>[-]<<<[->+>>+<<<]>>>[-<<<+>>>]<[-]+<[[-]>[-]<]>[[-]<<<<<<<<<<<<<<<[-]++>>>>>>>>>>>>>>>]<<<<<<<<<<<<<<<.>>>[-]++++.<<<<<.>>>>>[-].>>>>>>>>>]
Download the complete project and tests ↗
Read the programs in plain English

This is a simplified map of what the executable Brainfuck programs do. The .bf files above are the code that actually runs.

client.bf

WHEN you send a chat message
  package its type, number and text
  send it to the server

WHEN a chat message arrives
  show its text in the conversation
  send a delivery confirmation

WHEN a confirmation, pong or error arrives
  report it to the chat interface

server.bf

READ the verified sender, type, number and length
CHECK that the message is valid

IF it is a chat or delivery confirmation
  send it to the other participant
ELSE IF it is a ping
  send a pong back to the sender
ELSE
  send a protocol error back to the sender
The technical details, if you want them

What Brainfuck actually does

The client.bf and server.bf programs read every message, check that it is valid, decide where it should go and create delivery confirmations. A TypeScript interpreter runs those programs and understands only Brainfuck’s eight commands. TypeScript also provides the parts Brainfuck cannot provide by itself: the web connection, private room access, temporary storage and cleanup.

Each run gets 1,024 memory cells. Numbers wrap from 255 back to 0, and a run stops if it reaches one million instructions.

What travels between the two devices

verified sendermessage typemessage numbertext lengthtext…

A message starts with four small numbers, followed by up to 120 bytes of text. The message type says whether it is a chat, delivery confirmation, ping, error or pong. The room server replaces the claimed sender with the identity proved by that device’s room key. The sending page chooses the message number, and Brainfuck keeps it attached so a confirmation can be matched to the original message. Every message starts a fresh Brainfuck run with empty memory.

What the animation is showing

After a message is processed, the animation runs the same Brainfuck program again with the same input and checks that it produces the same result. It records each instruction and shows the first eight memory cells as they looked just before that instruction ran. “One step” moves forward by exactly one instruction. For live rooms, this is a verified reconstruction of the server run rather than a live view inside the server.

Is it really Brainfuck?

Yes. The programs that process messages contain only ><+-.,[]. A readable TypeScript builder creates those long .bf files so the project can label and maintain each part. The builder does not process any messages; the Brainfuck instructions it produces do. The download includes the builder, the generated .bf files and the tests.

Limits and privacy

A room holds two people. It expires after 30 minutes without activity or after two hours in total. It can hold up to 1,200 temporary message events. Leaving ends the room and deletes its queued events; expired rooms are cleaned up when another room is created. The site uses HTTPS, but the messages are not end-to-end encrypted.

A delivery confirmation means the other client processed the message; it does not mean the person read it. An open page checks for new messages about once a second. Background tabs and lost connections can cause delays. There is no permanent history, automatic resend or guaranteed offline delivery. Brainfuck cannot connect to the internet on its own, so TypeScript supplies that connection.