esolang

Hexlr7

An HQ9+ copy its own page calls terrible, with one command whose job is to crash.

Cortex, 2018 · Turing complete: no · ●○○ easy · esolangs.org

Tested with 5 known programs · Test method

Run it

Expected: Hello, World! JavaScript with ProcessingJS

The idea

Cortex made Hexlr7 on 18 December 2018 as a copy of HQ9+ that should be easy, but not too easy, to implement. Each letter prints one fixed line. X prints the source of a smaller interpreter that cannot run X, and R makes the interpreter throw an error on purpose. The only control is 7, which repeats the next command 7 times.

Read the story

The specification gives the interpreter, written for ProcessingJS. A 7 calls the interpreter again on the one character after it, and the main loop skips any character that follows a 7. So 77 repeats the command after the pair 49 times, and 77HH prints Hello, World! 50 times. 777H prints nothing at all, because the 49 repeats run a lone 7 with nothing after it.

The machine

CharDoes
HPrint Hello, World!
EPrint the link to this page on esolangs.org
XPrint a minified interpreter without X
LPrint JavaScript with ProcessingJS
RThrow an error, which ends the run
7Do the next command 7 times
77Do the command after the pair 49 times

Every print is a println, so each line ends with a line break. All other characters do nothing.

Example

The R in the last one stops the run, so the second H never prints.
Expected: Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World!
Expected: Hello, World!

The R in the last one stops the run, so the second H never prints.

Further

Also in Jokes

Write your own in Run Convert a program from Hexlr7

Implementation

JavaScript interpreter, source and command line

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

Command line

shib run hexlr7 -e 'H'
shib manual hexlr7

Source

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

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

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