beef(1)
π NAME π
beef β a flexible Brainfuck interpreter, and yes bestie, it really is called that π₯©
β¨ SYNOPSIS β¨
beef [OPTION]... FILE
π«Ά DESCRIPTION π«Ά
Okay so, beef? It's a flexible interpreter for the Brainfuck programming language. Iconic of it, honestly.
The whole vibe is that you can configure it with the options below, which means it can run Brainfuck programs that made assumptions about how the interpreter behaves. Like, it'll actually meet those programs where they're at. So thoughtful. π
And the memory tape? No arbitrary limit, periodt. beef allocates memory cells as they are needed, so your program can just keep on going. No cap. π¦
π OPTIONS π
-p,--program=PROGRAMβ RunsPROGRAMfor you. But listen, you can only use this if you did not hand it aFILEcontaining a Brainfuck program on the command line after all the options. Pick one, bestie, not both.-s,--store=WHATβ Chooses what value gets stored in the tape when we hit end of input.WHATdefaults tozero(stores a zero). Other options areeof(stores-1, the value usually assigned to the C constantEOF) orsame(leaves the value untouched, minding its own business).-d,--enable-debuggingβ Turns on debugging support. By default, debugging instructions are not executed. Like they're just sitting there, unemployed. π-o,--output-file=FILEβ Writes the program's output toFILE.-i,--input-file=FILEβ Reads the program's input fromFILE.
Also, FILE can be a local path or any URI supported by GIO. And if FILE is '-', then standard input or standard output gets used, depending on the context. Very demure, very mindful. πΈ
π§ BRAINFUCK LANGUAGE π§
So here's the tea. Brainfuck programs work on a memory tape, and that tape has a virtually unlimited number of cells. Each cell can store a value, and that value can be read either as a character or as an integer number (its ASCII encoding), depending on the context. There's also a cursor pointing at one of the cells β that's the "current" one β and you can move that cursor around whenever you feel like it. Main character energy, honestly. π
A Brainfuck source file is made up of a bunch of Brainfuck instructions, and literally any symbol that isn't an instruction is treated as a comment and ignored. There are exceptions to this rule though β see below, iykyk. π
The Brainfuck instructions are:
+β Increase the value in the current cell by one.-β Decrease the value in the current cell by one.>β Move the cursor one cell to the right.<β Move the cursor one cell to the left.[β Start a loop. The instructions inside the loop get executed as long as the value of the current cell is not zero.]β End a loop that was started by a'['instruction.,β Read a character from the input and store it in the current cell..β Write the value of the current cell to the output.#β Dump the content of the memory tape for debugging purposes. This instruction gets ignored unless theenable-debuggingoption is present. So it's just, like, napping otherwise. π€
If the first line of the source file starts with the magic sequence '#!' it gets ignored. This lets you execute a Brainfuck program without calling beef explicitly, exactly like you'd do for, say, a Python program. Slay. β¨
The symbol '!' has a special meaning to beef: it marks the end of a program's code and the beginning of its input. So if this symbol shows up in the source file, runtime input will be ignored. Just completely ghosted. π
π EXAMPLES π
The classic Hello World program could be written in Brainfuck as:
++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.++++++
+..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.
The following Brainfuck program can be used to replace the cat(1) utility:
#!/usr/bin/beef
,[.,]
That's of course assuming you don't need any of cat(1)'s fancy commandline options, you have a shell with working I/O redirection and a sense of humor. π
Okay bestie that's the whole page fr fr β go write something cursed in Brainfuck, you got this π
Signing off with all the love: this was beef(1) from the General Commands Manual, version 1.2.0. Mwah. πππ¦
π¦ where this page comes from
- ubuntu resolute: beef 1.2.0-2build3 Β· GPL-2.0-or-later
- ubuntu stonking: beef 1.2.0-2build3 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms