Hyperon
Paradigm(s) | Imperative |
---|---|
Designed by | Hakerh400 |
Appeared in | 2020 |
Computational class | Uncomputable |
Major implementations | Unimplementable |
File extension(s) | .txt |
Hyperon is a hypercomputable programming language that is strictly more powerful than Turing machine. It is a brainfuck derivative with the ability to solve the Halting problem.
Memory
Same memory model as in brainfuck (8-bit cells, unlimited tape).
Instructions
>
- Increment the data pointer<
- Decrement the data pointer+
- Increment the current cell-
- Decrement the current cell,
- Read a character from stdin and put it to the current cell.
- Output a character from the current cell[*]
- Repeat instructions inside brackets while the current cell is non-zero{*}
- If the instructions inside braces halt in finite time, increment the current cell, otherwise do nothing
Current cell is the cell pointed by the data pointer. Here *
means that anything can be there.
Examples
These examples describe only the last instruction, because we assume the reader is familiar with previous instructions.
For example, {}
(empty content between braces) is identical to +
instruction, because there are no instructions inside, so it will halt in finite time, and thus it is equivalent to incrementing the current cell.
Another example: {-}
. It is also equivalent to +
, because whatever happens inside {*}
does not have effects to the surrounding code (memory will not be changed and data pointer will also remain unchanged after exiting the {*}
braces, except incrementing the memory cell if the content halts). Also, any I/O that is performed inside {*}
will be reset when we exit {*}
.
This is equivalent to the cat program:
,[ {[-]+[...,.,.,,,>>>>>>[-]+]} // Just to show that this has no effects ., ]
Braces can also be nested, like {{}}
. It is important to note that {*}
is a single instruction (unlike [*]
) and takes a single tick, so {{*}}
is identical to +
, independently of the content inside (because the inner {*}
takes a single tick, and thus halts in finite time).