Unary++

From Esolang
Jump to navigation Jump to search

Unary++ is an esoteric programming language designed in 2024. Unary++ uses the bijective unary number system as source code. To write a program in Unary++, use the following steps:

1. Write your program in Unary.

2. Replace the 0s in the Unary program with the character as follow:

Unary Unary++
0 1

Number of symbols

According to the specification, Unary++ uses only one symbol. Some say the EOF character has to be counted as well, thus Unary++ uses 2 symbols. However, in most other Turing tarpits the EOF symbol isn't counted. Unary++ still has one symbol less than a Turing tarpit that uses two symbols in its specification, since such a language also has an extra EOF symbol.

Examples

Program that gets a single character and outputs it again

111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111

Infinite loop that does nothing but repeat (line breaks added for readability)

1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111

11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111

Cat program, EOF returns 0:

Too large to show here. It's 56623 one digits in a row, about 7 kilobytes.

Hello, World:

Has 142,209,095,870,573,693,396,245,504,627,320,468,349,603,549,841,832,242,891,887,476,756 ones.

Quine

There is a quine, which is a very long string of 1s that is quite impossible to be presented here or run to completion in an interpreter. A file containing the program in Unary++ would be super large.

Designing Unary++

It's easy to design such an esolang by recoding one which already exists. Another similar way to create a new one is to add a new command which prints 42 to an esolang.

Conclusion

Suffice to say, the Brainfuck program Lost Kingdom would generate a very large source file in Unary++.

See also

Compiler

Python:

print(input().replace('0','1'))