Can you create a programming language with just one symbol?
Asked Answered
R

2

6

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

Roadside answered 21/3, 2018 at 5:6 Comment(2)
esolangs.org/wiki/UnaryErnieernst
It could be done, but it would be so inefficient it seems pointless. Do consider that Brainfuck, for all its simplicity, is very educational through its computation model.Sherlocke
G
7

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.

Gomphosis answered 21/3, 2018 at 6:1 Comment(1)
LOL. My thought exactly. Godel Numbering is an alternative. Just to make things harder you understand!Synodic
H
1

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.

Headstall answered 5/9, 2018 at 8:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.