Can you create a programming language with just one symbol?

955 Views Asked by At

Can you create a programming language with just one symbol like brainfuck.

2

There are 2 best solutions below

1
Torinthiel On

Yes, it has been done before - see Unary.

Basically it's a strange encoding of brainfuck. Treat each BF command as a number. The whole program is then also a number, created by concatenating the commands together (with an extra 1 at front, for unambiguous decoding). Convert the number to unary numeric system (aka the number of digits is your number) and you're done.

Note however the programs in this tend to be very large - a cat implemented in Unary is (according to the information on page) 56623 characters long.

MGIFOS, Lenguage and Ellipsis follow the same principle. Note that e.g. a hello world in MGIFOS

has more characters than particles in the observable universe

Then Len(language,encoding) extends this principle to any language.

0
AlainD On

They are called OISC One Instruction Set Compiler. The first one know of is Melzak's Arithmetic Machine (1961), with the instruction:

z = x-y or jump if y>x

You also have Zero Instruction Set Computer, which are more like neural nets.

Not forgetting the amazing FRACTRAN of Conway & Guy (1996), with no instruction but interprets a series of fractions (the program) in a Tuning complete way.