Pbrain

From Esolang

Jump to: navigation, search

The pbrain programming language is an extension of the Brainfuck programming language that adds support for procedures. This is done with the addition of the instructions :, (, and ) to the existing Brainfuck instructions. pbrain was created by Paul M. Parks in 2004.

A procedure is delimited by the ( and ) instructions. It assigned a numeric identifier equal to the contents of the active cell at the time the ( is encountered. For example, the following pbrain program creates a procedure numbered "1" that will increment the active cell:

+(+>)

To call this procedure, the active cell is set to 1 and the procedure is called with the : instruction. Assuming the current cell is zero, the following will call the above procedure:

+:

[edit] Implementation

A C++ interpreter and a C# compiler for Microsoft .NET may be found at http://www.parkscomputing.com/code/pbrain/

Brainfuck Developer, a comprehensive Brainfuck IDE for Windows, supports pbrain.

A concise interpreter in C is available at http://www.hevanet.com/cristofd/pbrain.c. I have tried to complete the semantics the cleanest way I could.

[edit] External resources

The official pbrain site

Personal tools