esolang

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

Expected: 0

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

InstructionDoes
MOV V TASMove the pointer V cells; back to the start
ADD V SUB V ZERChange the cell; set it to 0
INP CHR VALRead a number into the cell; print it as a character; print it as a number
LBL L GTO L CBZ LA label; jump to it; jump to it if the cell is 0
QNE HLTPrint 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.

Expected: HI
Expected: QNE

Further

Ideas it shows

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 something

Source

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