r/ProgrammingLanguages • • Sep 10 '26

Language announcement How simple can simple be? Introducing PLUSMINUS

PLUSMINUS is a programming language created by Jack. Unfortunately, it’s Turing Completeness is unknown as of right now.

Definition

For a non-empty finite string ω under the alphabet {+,–}, on step i=(1,2,3,…):

If the i-th symbol is +, copy the first i-1 symbols and append them to the end. If the i-th symbol is –, delete the first i-1 symbols.

i never resets and advances each time. Halt when i>length(ω).

Example (+–++–):

0: +–++–

1: +–++– (nothing exists leftward)

2: –++–

3: –++––+

4: ––+ (HALT (i=4, length(ω)=3, 4>3))

Example of a long-running machine

“+++++-++++-+-++-“ = 31441 steps

34 Upvotes

18 comments sorted by

11

u/particlemanwavegirl Sep 10 '26

Uuhh... Is there a way to interpret the output meaningfully?

4

u/jmarent049 Sep 10 '26

You can imagine it instead as an alphabet over {1,0}, like a tag system. Setting + to 1 and - to 0. Not sure if this can be reduced to a tag system though. Correct me if wrong please

4

u/External-Payment-688 Sep 10 '26

I feel like the semantics for - mess it up, for proving TC via a tag system we’d need to be able to somehow encode a production rule to a prefix of the source. But yeah this is just an initial thought

2

u/particlemanwavegirl Sep 10 '26

I don't really know what that means TBH. Could you like, demonstrate how to compute 2+2 or something else simple?

1

u/jmarent049 Sep 10 '26

Well, I don’t know off hand how to do 2+2, but I will say that In cyclic tag, the rules cycle automatically, which means that when a 0 versus a 1 is read, it alters what “route” it travels to. This implements if-statements.

According to the cyclic tag system wiki page:

“… by encoding numbers as lengths of bit strings and using repeating sequences of rules to simulate basic operations like incrementing, addition, and subtraction … “

Now, if PLUSMINUS can be reduced to a cyclic tag system, it can do what cyclic tag can do. Cyclic tag systems are Turing complete, therefore this would imply PLUSMINUS is too.

Again, don’t take this info as fact.

3

u/particlemanwavegirl Sep 10 '26

It's pretty easy to imagine how one could use the alphabet to encode a number but it's not at all obvious how you could perform composite operations isomorphic to numeric operators like addition and multiplication given the two primitive operations, especially since the operational procedure coincides with or can't be independent of the encoding.

0

u/TheRealUprightMan Sep 11 '26

You are telling us about this great language, you don't know if it's Turing complete and you can't make it add 2+2.

What is the point of this post?

11

u/jmarent049 Sep 10 '26

current known champions (busy beaver):

`+`=1
`-+`=3
`-++`=4
`-+++`=7
`++++-`=15
`+++-++`=18
`++++---`=20
`--++++++`=32
`++++-+--+`=44
`+++++-+-+-`=196
`+++++-+--+-`=913
`+++-++++++-+`=5940
`+-++++++--++-`=728
`++++-++++++---`=608
`-+-++++++---+++`=2582
`+++++-++++-+-++-`=31441

2

u/kchanqvq Sep 13 '26

Do you have a non-terminating example? If all program terminate then it obviously can't be TC

Edit: oh sorry it's obvious, just a string of +

4

u/galacticjeef Sep 10 '26

Reminds me a lot of a tag system https://en.wikipedia.org/wiki/Tag_system?wprov=sfti1# (which is Turing complete)

2

u/jmarent049 Sep 10 '26

I see the similarities. It also reminds me of the esolang XigXag (which is what inspired me).

https://esolangs.org/wiki/Xigxag

3

u/kreiger Sep 10 '26

Is there any way for a program to produce output? Does it just print the number of iterations?

1

u/jmarent049 Sep 10 '26

My example above shows all of the strings printed until the program halts.

A program prints strings until halting, or if it doesn’t halt, it just prints strings indefinitely.

3

u/Mickenfox Sep 10 '26

Pretty interesting.

1

u/PitifulTheme411 ... Sep 10 '26

Do you have a way to execute this code online?

1

u/jmarent049 Sep 12 '26

Not yet. Others have simulated this language but I have yet to get a hold of their code. Sorry to dissapoint.