BinaryLanguage

From Esolang
Jump to navigation Jump to search
BinaryLanguage
Official logo of BinaryLanguage
Paradigm(s) unknown
Designed by User:None1
Appeared in 2023
Memory system Accumulator-based
Dimensions one-dimensional
Computational class Turing complete
Reference implementation Official interpreter in Python
Influenced by brainfuck
Befunge
File extension(s) .bl

BinaryLanguage is an esolang created by User:None1 which uses some simple binary operations.

Memory Model

BinaryLanguage uses three registers (initially zero): A, B and C. They can contain unsigned integers of any size (or up to at least 210000).

Commands

BinaryLanguage Commands
Command Meaning Example
+ Increments A A=1,B=2,C=3 → A=2,B=2,C=3
- Decrements A (Note: If A=0, then A is unchanged) A=1,B=2,C=3 → A=0,B=2,C=3
& Bitwise and A and B, stores the result in A A=1,B=2,C=3 → A=0,B=2,C=3
^ Bitwise xor A and B, stores the result in A A=1,B=2,C=3 → A=3,B=2,C=3
| Bitwise or A and B, stores the result in A A=1,B=2,C=3 → A=3,B=2,C=3
< Bitwise left shift A by B bits, stores the result in A A=1,B=2,C=3 → A=4,B=2,C=3
> Bitwise right shift A by B bits, stores the result in A A=17,B=2,C=3 → A=4,B=2,C=3
~ Swaps A and B A=1,B=2,C=3 → A=2,B=1,C=3
* Performs a right circular shift to the three registers A=1,B=2,C=3 → A=3,B=1,C=2
( If A=0, jump to the matching ) -
) If A!=0, jump to the matching ( -
, Reads a character from user input and stores its ASCII value to A -
. Output the character with its ASCII value the same as A -

Incorrect commands echo themselves.

Example Programs

Hello World (also a Quine)

Hello World!

Cat Program (never terminates)

+(~,.~)

Truth Machine

+++~++++~<~,^(^(.))^.

Turing Completeness

BinaryLanguage is Turing complete as a conversion from brainfuck is possible.

BinaryLanguage conversion from brainfuck
brainfuck BinaryLanguage
+ (-)+<(*+**-)
- (-)+<(*-**-)
> ~++++++++~
< ~--------~
, (-)+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<*~&~^**,<|
. (-)+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<*~&~**>.
[ (-)+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<*~&~**>(
] (-)+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<*~&~**>)

External Resources