Brainfuck File Extensions

BrainphantomBrainphantom
3 min read

Introducing:

Brainfuck is a minimalist programming language created by Urban Müller in 1993. Known for its simplicity and extreme conciseness, Brainfuck consists of only eight commands:

. , + - [ ]< >

Brainfuck File Extensions:

.b and .bf

The most commonly used file extensions for Brainfuck programs are .b and .bf. These extensions are simple and straightforward, reflecting the minimalist nature of the language. For example, a Brainfuck program might be named hello.b or hello.bf.

.brainfuck

Another extension, though less common, is .brainfuck. This extension is sometimes used to clearly indicate that the file contains Brainfuck code, even though it is a bit verbose compared to typical language conventions. A file might thus be named hello.brainfuck.

Other Extensions:

Although less common, some communities or individuals may use custom extensions for Brainfuck, such as .bfk or .bfrk. These extensions are generally specific to particular environments or tools.

Brainfuck File Names:

Regarding file names, there are no strict rules in Brainfuck. However, given the simplicity of the language, file names tend to be short and descriptive. Here are some examples of naming conventions for Brainfuck programs:

Basic Programs:

• hello.b: A simple program that prints “Hello World”.

• adder.bf: A program that performs simple additions.

• fib.b: A program that calculates Fibonacci numbers.

Descriptive name:

For more complex projects, it can be useful to use more descriptive names:

• mandelbrot.bf: A program that generates a Mandelbrot set.

• sort.b: A program implementing a sorting algorithm.

Functionality-Based Names:

File names can also reflect the functionality or algorithm implemented:

• bf_interpreter.b: A Brainfuck interpreter written in Brainfuck.

• quine.bf: A program that self-reproduces.

Conclusion:

While Brainfuck is a challenging programming language with an extremely minimalist syntax, the conventions for naming files and extensions remain simple and intuitive. Common extensions like .b and .bf allow for easy recognition of Brainfuck files, while descriptive file names help to quickly identify the program’s function.

CharacterMeaning
>Increment the data pointer by one (to point to the next cell to the right).
<Decrement the data pointer by one (to point to the next cell to the left).
+Increment the byte at the data pointer by one.
-Decrement the byte at the data pointer by one.
.Output the byte at the data pointer.
,Accept one byte of input, storing its value in the byte at the data pointer.
[If the byte at the data pointer is zero, then instead of moving the instruction pointer forward to the next command, jump it forward to the command after the matching] command.
]If the byte at the data pointer is nonzero, then instead of moving the instruction pointer forward to the next command, jump it backto the command after the matching[ command.

I hope this post will be helpful and assist you in navigating the world of Brainfuck.

1
Subscribe to my newsletter

Read articles from Brainphantom directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Brainphantom
Brainphantom

I am a French developer specializing in Brainfuck