We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.
Malbrain
Malbrain is an esoteric programming language with only 2 commands: > and .. Due to the design, it is also extremely hard to maintain, since each command is relative to the previous.
Malbrain is translated to brainfuck before it is executed and so is computationally equivalent to brainfuck. This is NOT the same as a turning tarpit.
Commands
The commands are:
| Token | Action |
|---|---|
> |
Next command |
. |
Use command |
The command number starts at 0 at the beginning, which is >. The output commands, their arrangement, and internections, are as follows:
| Number | Current brainfuck command | Next brainfuck command |
|---|---|---|
| 0 | >
|
<
|
| 1 | <
|
+
|
| 2 | +
|
-
|
| 3 | -
|
.
|
| 4 | .
|
,
|
| 5 | ,
|
[
|
| 6 | [
|
]
|
| 7 | ]
|
>
|
Like brainfuck, all non commands are considered comments. If the command goes past the list, it restarts to 0.
Examples
Hello World!
This is the brainfuck hello world converted to malbrain
.>>.........>>>>.>>>.>........>>>>>>.>>>.>>>>.>>.>>>.>>>>. >>.......>>>>.>>>.>....>>>>>>.>>>.>>>>.>>.>.>>.>>>>>>....... >>..>>>>>>...>>.>>>>...>>........>>>>.>>>.>....>>>>>>.>>>.>>>>. >>.>>>.>>>>...>>..........>>>>.>>>.>.........>>>>>>.>>>.>>>>.>>. >>...>.>>>>>....>>>.>>>>>>...>>.>>>>>>>......>.>>>>>>>........>. >>>>..>>.>>.
Cat program
This is malbrain cat (No change on EOF)
>>>>>.>.>>>>>>.>>.>>>>>.>>>>.>>>>>>.>>.
Truth-machine
A truth-machine is operated in this example:
>>>>>.>>>>>>>.>>.>>>>>..>>>>>.>>.>>>>.>>..>>>>>>>.>>.>>>>>.>>>>>>.>>>.>>..>>>>>>.
External resources
- Malbrain Source Code
- Malbrain ELF (libc6)
- Malbrain Win32
- Common Lisp implementation of the Malbrain programming language. The project also comprehends converters betwixt Malbrain and brainfuck in both directions.