esolang

Heck

A program is a hexadecimal number, so that the reader says "What the heck?!"

PixelatedStarfish, 2021 · Turing complete: yes · ●○○ easy · esolangs.org

Tested with 3 known programs · Test method

Run it

Expected: HELLO WORLD

The idea

PixelatedStarfish made Heck in 2021, first thinking of it like Lenguage, where a number is turned into bits and run. What came out is a small stack language in which every operation is one hex digit. Seven of the sixteen take an argument of two more hex digits, so 648 is "push 0x48" and the 8 after it is "print". The specification shows each program with its parse, slashes between the codons, because the plain number is unreadable.

The machine

One stack of integers and labels numbered 00 to FF.

DigitDoes
0V 1VAdd V to the top, subtract V from it
2L 3LJump to label L, mark label L
4L 5LJump to L if the top is 0, if the stack is empty
6V 7Push V, pop
8 9 APrint the top as a character, in decimal, in hex
B C D EDuplicate, shuffle, empty the stack, pop two and push the sum
FEnd

Example

The Hello World from the specification, which parses as 648/8/645/8/64C/8/....

The Hello World from the specification, which parses as 648/8/645/8/64C/8/.... Each letter is pushed and printed, and the letters are capitals.

The truth machine pushes a 0, prints it, and jumps to the end because it is 0.

Expected: 0

Further

Ideas it shows

Stack-based

Write your own in Run Convert a program from Heck

Implementation

JavaScript interpreter, source and command line

A JavaScript interpreter, used in the browser and on the command line. Id: heck.

Command line

shib run heck -e '6003009401200301'
shib manual heck

Source

Module
langs/wiki/ports.js
Interpreter
langs/wiki/heck.js

Docs: Kernel instructions · The .shib format · Command line · Adding a language

Source esolangs.org (CC0) · Edit on esolangs.org