Something
Brainfuck with labels and 13 instructions, and only one error message: Oops! Something went wrong!
PixelatedStarfish, 2021 · Turing complete: yes · ●○○ easy · esolangs.org
Tested with 3 known programs · Test method
Run it
The idea
PixelatedStarfish made Something in 2021, after brainfuck and the ARM64 instruction set. There is a tape of byte cells and a pointer, as in brainfuck. The program is one instruction per line, written as a three-letter word like an assembler, and loops are made with labels and jumps instead of brackets.
Read the story
Whatever goes wrong, the language says the same thing. It also has an instruction just for its quine. QNE prints QNE.
The machine
| Instruction | Does |
|---|---|
MOV V TAS | Move the pointer V cells; back to the start |
ADD V SUB V ZER | Change the cell; set it to 0 |
INP CHR VAL | Read a number into the cell; print it as a character; print it as a number |
LBL L GTO L CBZ L | A label; jump to it; jump to it if the cell is 0 |
QNE HLT | Print QNE; stop |
<text> is a comment and may span lines. A brainfuck [ is CBZ, and a ] is a CBZ past a GTO back to the top.
Example
The truth machine from the specification.
The truth machine from the specification. With a 0 it jumps straight to LBL 0 and prints the 0; with a 1 it prints 1 forever.
Further
Ideas it shows
See also
Cell-based
Write your own in Run Convert a program from Something
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: something.
Command line
shib run something -e 'QNE'shib manual somethingSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/something.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org