BFDev

**What is BFDev?**

Brainfuck Developer is a Win32 tool for writing, debugging, and (in some degree) understanding Brainfuck programs. Its main feature is an integrated debugger with support for single-step trace, run-to-cursor, and interactive memory inspection. It is a development tool, not only a simple interpreter.

With the "Watch Program Operation" feature, you can watch your BF code running to go get an impression what your program does. In addition, BFdev features "piping" input and output data to files. You can set an input file from which the input data is read, and an output file to which all output data is written (in binary). Given this ability, BFdev is just as powerful as console interpreters.

Since version 1.4.0, BFdev supports the pbrain (procedural brainfuck) language extension. This extension adds three new commands to the BF language. A very useful feature integrated in BFdev since version 1.4.6 is the **Text Generator**, a tool that generates BF code for printing text.

There is nothing to say about how BFdev works. Everyone who has already worked with an IDE like Visual Studio, Delphi, or Turbo Pascal knows the basic functioning of BFdev. (To those who have not: do you *really* wanna code Brainfuck? ;) All of the program's functions are self-explanatory.

**Technical details**

For Brainfuck programs, the interpreter provides the following "virtual machine":

* Memory size: 32768 cells à 8 bit or 16 bit (selectable)
* If the pointer leaves the legal memory bounds (underflow or overflow), wrap-around occurs.
* Procedural BF (pbrain) is supported. Stack size is 65536.
* BF interpreters often have a "bracket nesting limit". BFdev does not. It supports an infinite number of nested brackets (only limited by your available RAM).
* The interpreter ignores all characters in the code that are not Brainfuck commands.
* Complete lines can be commented out by using one of the following comment markers. They MUST be the first non-whitespace character of the line. Comment markers may be disabled. Comment markers are: ; / \* ' % #
* *BFdev utilizes buffered output for printing.* This increases performance since the slow API calls don't have to be made each time a single character is printed. Buffering may cause the output appear choppy, especially on slow computers. *If a BF program is very slow, it may appear hanging*, but that's generally not the case. The characters it prints are just not immediately shown on screen! You can change the buffer size or disable it by choosing "Set Output Buffer Size" in the "Extras" menu. Additionally, you could press F8 to pause the program and to flush the output buffer.
* Programs can indicate a new line by printing the characters LF (#10), CRLF (#13#10), CR (#13), or LFCR (#10#13).
* Under Windows XP, BFdev runs optimal. Under Windows 95/98, BFdev cannot produce output greater than 64 KB. This is due to limitations of the operating system (the Windows 95/98 multiline edit component is restricted to 64 KB).

**The pbrain language extension.**

Pbrain means "procedural brainfuck" and enables you to define and call procedures in your BF programs. For this purpose, pbrain adds three new commands to the BF language: "(", ")", and ":".

* "(" starts definition of a procedure. This newly created procedure will be referenced with the value that's in the current memory cell.
* ")" ends the definition.
* ":" calls that procedure that is referenced by the current memory cell.

BFdev does not tolerate calling of undefined procedures. In this case, it will report an error. BFdev offers a stack of 65536 entries, that means you can nest procedures until a depth of 65536. There is *no* stack overflow checking. This doesn't mean BFdev crashes if the stack grows too big, but instead, *your* program crashes and you probably wouldn't know why. The IDE itself doesn't crash when the stack overflows (I cared for this).

You can enable or disable pbrain support by checking or unchecking "Enable Procedural BF" in the "Interpreter" menu, by pressing Ctrl+P, or by clicking the pbrain button in the tool bar.

**Sourse of.**

* https://habr.com/ru/post/95126/.
* http://www.4mhz.de/bfdev.html.