Talk:Pistons & Pistons

From Esolang
Jump to navigation Jump to search

I just implemented the infinite loop program in Minecraft. It works (although I don't see an x in the source to be output). Each piston is a sticky piston with a redstone block attached. First piston has a button next to it to start. For output or stack command blocks could be used. I did try noteblocks above the gap between blocks which played a sound for output. This could be a fun thing to develop further. Split / double headed pistons could be useful. I could post a screen shot or layout diagram at some point. Salpynx (talk) 19:26, 5 July 2019 (UTC)

I can’t tell if you’re joking or not, but I appreciate this. Areallycoolusername (talk) 21:19, 5 July 2019 (UTC)
I was being serious. I like the idea of this language, and physical computation in general. When I read this I knew the simulation of pistons in Minecraft could be used to implement the chaining and looping you described. Many people make computing devices in Minecraft So this isn't so strange. Those gates use features of Minecraft that aren't in this language.
I've been thinking how to expand this lang with a small change, and have come up with a new piston type to add which can push another piston or character one space: ▢╢ It can push, but not pull. When it pushes another piston, it does not trigger but moves it 1space. For a character, it moves then triggers it in the new space. This enables signals to cross 'wires'. I've sketched out a latching AND gate (+ more complex non-latching version) and an XOR gate, and I believe a Toffoli gate can be made, which is universal (there's a reason to not choose NAND). This proposed push mechanism should enable single bit storage cells, so all together there should be enough to create a very low level BSM of any size. Apologies if I'm taking this _too_ seriously :) Salpynx (talk) 23:00, 8 July 2019 (UTC)
This language was originally going to be trivial, however, seeing the potential of this language due to your input proves that we can make this language full blown with control flow, variables, and gates. I was thinking implementing if statements and variables like this:
▢┤H,3▢┤?H=3
           ▢
           ┴
           X

The integer value 3 is placed in variable H. The question mark starts the if statement, which checks if H is equal to 3. Then, the downward piston acts as the body of the statement, which pushes X into the screen. Gates could be implemented in the way you described. Input variables could also be implemented like this:

▢┤Pi,in.char▢┤?Pi#a▢┤F
                  ▢
                  ┴ 
                  T                 

This program makes the variable Pi accept character input. There will be int, char, and bool data types in the language. Then, the if statement checks if Ok is equal to "a". If so, then T is pushed into the stack. Else, then F is pushed into the stack. Else statements must always be placed to the right of the initial if condition. The if statements must be placed below the condition. This allows for branching.Areallycoolusername (talk) 15:16, 9 July 2019 (UTC)

(By the way, I am quite sure that there is the trend of this language becoming line noise. (i.e. write-only) This seems to be slightly hard to read without special help. If that is not what you want, you can replace these contractions by full words.)
Implementing nested if statements might be like the following code snippet.
▢┤Pi,in.int▢┤?Pi=111▢┤F
                  ▢
                  ┴
                  P
                  i
                  ,
                  i
                  n
                  .
                  i
                  n
                  t
                  ▢
                  ┴
                  ?
                  P
                  i
                  =
                  1
                  1
               T├▢1
                  ▢
                  ┴
                  F
As far as I can tell, this extension makes it a bounded-storage machine, as it can compile to a Wang's B machine with bounded storage. I assume that this extension has a finite number of registers, represented by x.
  • Mark: x,1
  • Moving left & right: Switch around the registers
  • Conditionally jump to the instruction labelled k if the current cell is marked: ?x=1 and then branch to a specific part of the program using pistons.--A (The reason FORTRAN has a three-way branch – IF (ABC) 1,2,3 – is because the machine had a three-way branch, and that way they could generate that in a single instruction.) 03:19, 10 July 2019 (UTC)

Can pistons be split to allow branching, like this? This program allows arbitary characters to be outputted as the program continues to run; i.e. a Hello, world! program:

▢┤H
┴
▢┤e
┴
▢┤l
┴
▢┤l
┴
▢┤o
┴
▢┤,
┴
▢┤ 
┴
▢┤W
┴
▢┤o
┴
▢┤r
┴
▢┤l
┴
▢┤d
┴
▢┤!

--A (The reason FORTRAN has a three-way branch – IF (ABC) 1,2,3 – is because the machine had a three-way branch, and that way they could generate that in a single instruction.) 08:50, 6 July 2019 (UTC)

No, splitting in the way you described isn't possible. However, it gave me an idea. Instead of all the piston having to be activated by another piston, a piston would be able to be activated by an ASCII character whose value is in the accepted range of 32-126. Splitting in this way:
 
▢┤H ▢┤e 
   ▢
   ┴
   l

Is acceptable with the new mechanism I described. Programs would be checked left to right , however, when a downward branch is detected, it's checked first, then, the program is continued rightwards.Areallycoolusername (talk) 15:37, 7 July 2019 (UTC)

Potential Interpreter

Say an interpreter was to be made for Pistons and Pistons. What would the file extension be? JonoCode9374 (talk) 02:28, 9 July 2019 (UTC)

that is, of course, the actual p&p file JonoCode9374 (talk) 02:32, 9 July 2019 (UTC)
The script may be entered manually (as in Minecraft). However, if piles were supported, the extension would be "*.pnp".Areallycoolusername (talk) 07:59, 9 July 2019 (UTC)

Validity?

Is the proof of Turing completeness in the page valid?Areallycoolusername (talk) 15:44, 9 July 2019 (UTC)

I can't understand what it's trying to say. I don't think you mentioned your extension in the page. --A(User talk:A) 03:21, 10 July 2019 (UTC)
Not as the language is described on the page. Variables are not mentioned in the current spec, and FWIW I don't think they should be as this language was originally tagged Category:Low-level. As currently described, the language is simple print-only with infinite loops. I was trying to suggest a single minimal modification to make it a bounded storage machine physical tarpit, capable of of building real computing devices, but still not TC. Like how transistors are not TC. Salpynx (talk) 21:43, 10 July 2019 (UTC)

Language origin

Is it me or this language has been inspired by a videogame? Bog'riquet De FerChef (talk) 11:54, 7 December 2020 (UTC)