something positive

From Esolang
Jump to navigation Jump to search

something positive is an esolang by User:PythonshellDebugwindow.

Overview

something positive is a string-rewriting language. Programs take a program in a program-specified language as input and produces the program, with rewriting rules applied, as output; if the input and output programs are the same, the program halts immediately, but if they are different, the program never halts. The brainfuck programs +[] and ++[] are different (because the tapes end up with 1 and 2 respectively, not because of the differing lengths, so +[] and ++-[] would be the same), but the Nil programs A and B are the same. Neither the input program or the output program are ever executed.

Syntax

The first line of the program specifies the language to be used. The remaining lines are the rewriting rules, each in the form of string → replacement. Each rule is applied in turn, so each line is executed exactly once. Each rule matches as many times as possible, but X → X won't go into an infinite loop, as rules don't overlap.

Examples

Hello, World!

Quine
 → Hello, World!

Input nothing. Loops forever. Note the leading space.

Cat program

Text

No rewriting rules are applied, so the input and output are the same.

Truth-machine

Always outputs 0.

Stackint
0 → 1
1 → 0