PureBrainz ? How cryptic !

Again, go check out the source on Github ! I’m pretty pround of the Interpreter.py code !

You can also check out the esolang wiki page, which explains it pretty well.

“This language inspired by brainfuck tries to keep the basis, the spirit, while implementing proper tools to make programs.
These tools include ‘’variables’’ (anchor-points) in the memory-tape, ‘’multiple kinds of loops’’, that can either be hard-coded or depend on a memory cell, as well as ‘’functions’’ that can take in pointer positions as arguments, and ternary operations (if/else), and finally, ‘’modules’’, which means you can create a package manager, and have libraries ! You can too, import raw data from files.”

First of all, what is brainfuck ?

brainfuck is an esoteric programming language. It works with a memory tape and a set of instructions:

Symbol Instruction Memory before Memory After Console Input Console Output
+ Adds 1 to the cell [0,] [1,]
- Adds -1 the cell [1,] [0,]
> Moves One place to the right [0, 0,] [0, 0,]
< Moves one place to the left [0, 0,] [0, 0,]
. Prints the character [72,] [72,] H
, Inputs a character [0,] [101,] e
[] Loops until cell is 0 [0,] [0,]

For example, Hello World is:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
+++++ +++               Set Cell #0 to 8
[
>++++ Add 4 to Cell #1; this will always set Cell #1 to 4
[ as the cell will be cleared by the loop
>++ Add 4*2 to Cell #2
>+++ Add 4*3 to Cell #3
>+++ Add 4*3 to Cell #4
>+ Add 4 to Cell #5
<<<<- Decrement the loop counter in Cell #1
] Loop till Cell #1 is zero
>+ Add 1 to Cell #2
>+ Add 1 to Cell #3
>- Subtract 1 from Cell #4
>>+ Add 1 to Cell #6
[<] Move back to the first zero cell you find; this will
be Cell #1 which was cleared by the previous loop
<- Decrement the loop Counter in Cell #0
] Loop till Cell #0 is zero

The result of this is:
Cell No : 0 1 2 3 4 5 6
Contents: 0 0 72 104 88 32 8
Pointer : ^

>>. Cell #2 has value 72 which is 'H'
>---. Subtract 3 from Cell #3 to get 101 which is 'e'
+++++ ++..+++. Likewise for 'llo' from Cell #3
>>. Cell #5 is 32 for the space
<-. Subtract 1 from Cell #4 for 87 to give a 'W'
<. Cell #3 was set to 'o' from the end of 'Hello'
+++.----- -.----- ---. Cell #3 for 'rl' and 'd'
>>+. Add 1 to Cell #5 gives us an exclamation point
>++. And finally a newline from Cell #6

Well well, this isn’t very elegent, and it’s not the goal !
Let’s switch to PureBrainz, let’s see what this is capable of:

PureBrainz

Concept PureBrainz Syntax Utility example
Increment + do basically any data operation
Decrement - do basically any data operation
Output . print strings
Input , take info from user
Explore Memory (move left) < access data
Explore Memory (move right) > access data
While Loop [] Loop over structures
Repeat Action X() Do things repeatedly (hardcoded)
Repeat Action $var() Dynamically loop depending on data
Access Loop Index %() Do different things depending on the iteration count
If statement ?() Check for boolean values
If not statement !() Check for boolean values
Declare a variable #variable Save values or points in memory for future use
Goto a variable @variable Access data
Declare a function #function(*arg1*arg2){} Reuse code in a modular way
Call a function :function(*arg1*arg2) Reuse code in a modular way
Import a module |~Module| Use modules to make workflow easier
Read FileSystem "|~filename|" Read and process data from files
Hardcode a String "string here" Use text easily

Okay, what can you do with this ?

Concept PureBrainz Syntax Input Memory Output Memory
Empty Cell $(-) [326,] [0,]
Addition (non-destructive) @c $(-) $a(+) $b(+) [4(a), 3(b), 0(c),] [4, 3, 7,]
And More Coming Soon...

Programs

  • Fibonacci Sequence

    1
    0(+)>1(+)> 23( #c<#b<#a @c $a(+) $b(+) > )
  • Powers of Two

    1
    |~Math| #base 2(+) @12 #index + @0 >< 11(#i @index+ @i > :pow(*base*index*here*11))