bf

Home page
What's new
Computers
BeOS
Night & Day
Bing
MediaInfo
bf
UMM
addappinfo

Send Feedback

Sep 23 2000

What it does

bf is a really minimalist language. It only has 8 instructions, with no parameters. Call it a RISC with a 3-bit instruction set if you want.
Although very small, bf is what's called a Turing-complete language, i.e. it belongs to the same class of programming languages as C, C++, pascal, etc..., which means that any program written in C++ can (theoretically) be compiled into bf, and vice-versa.

Licence info

bf is released under the terms of the GNU General Public License, which basically means that the source file is freely available, and that everybody can read it, modify it, improve it and distribute improved versions. This also means that it comes with ABSOLUTELY NO WARRANTY

Features

Basic functions
Run it as bf <program name> from the command-line, and it will run the program.

What does a bf program look like?

This implementation of bf uses a one-dimentional infinite memory of 64-bit memory cells. Here are the instructions, where p is the pointer to the current cell, and m is the value under the pointer.
+ increments m
- decrements m
> increments p
< decrements p
. writes m to stdout (as an ascii value)
, reads m from stdout (as an ascii value)
[ starts a loop, with m as counter
] ends a loop

Here's a program (a basic implementation of Hello, World!) :

++++++++++++++++
++++++++++++++++
++++++++++++++++
++++++++++++++++
++++++++
.
++++++++
++++++++++++++++
+++++
.
+++++++
.
.
+++
.
---------------
----------------
----------------
----------------
----
.
------------
.
++++++++++++++++
++++++++++++++++
++++++++++++++++
+++++++
.
+++++++++
+++++++++++++++
.
+++
.
------
.
--------
.
----
----------------
----------------
----------------
---------------
.
----------------
-------
.

Version history

Version 0.1.1, Nov 27 1999
Re-release under a new name, no change
Version 0.1, Nov 25 1999
First release

Download

Binary for x86 (R4.5.2) (16 kB).
Sources (15 kB).