|Computational class||Turing complete|
|Major implementations||GitHub repository
In PIGS, data is stored in variables that can be referenced through pointers. Variables are numbers that can be from 0 to 4294967295 (unsigned 32-bit). Each of the commands, except for
#, is pointer-based. Each command takes a parameter in binary (
1s) that directly follows the command symbol.
Command descriptions are taken from the GitHub repository.
||Prints the corresponding character of the variable that the parameter points to. If this is impossible, then it prints nothing.|
||Takes input starting with the variable that the parameter points to. The corresponding number of each character is stored.|
||Starts running from a specific index (0-indexed) of the commands, specified by the variable that the parameter points to. If the index goes past the end of the code, then the program is terminated.|
||Prepares to set the variable that the variable that the parameter points to, points to. By default this is 0.|
||Adds the variable that the parameter points to to the prepared variable.|
||Subtracts the variable that the parameter points to from the prepared variable.|
||Sets the prepared variable to 1 if it is equal to the variable that the parameter points to, otherwise 0.|
||Sets the prepared variable to the variable that the variable that the parameter points to, points to.|
||Sets the variable to the parameter.|
I commands use Unicode. All characters besides those described above are treated as comments. Because of how the language is designed and how it filters out anything that is not recognized as a command with a parameter, it is impossible to run into errors.
Examples are taken from the GitHub repository.
- Hello, world!:
- Infinite loop:
- Cat program:
- Scream very loudly:
Although there have been no proofs on PIGS's computational class yet, it is largely believed to be Turing complete as long as number values are unbounded because it can handle conditional branching and has the ability to change an arbitrary amount of memory.
It is thought to be that only the characters
# are needed for Turing-completeness.