esolang

Luminol

Text and numbers are the same bytes. Print a number as text and you see its letters.

Zaikawo, 2024 · Turing complete: yes · ●○○ easy · esolangs.org

Tested with 3 known programs · Test method

Run it

Expected: Hello, World!

The idea

Zaikawo made Luminol in 2024 and named it after a Steven Wilson song. It looks like an ordinary curly-brace language, but there is only one kind of value, a list of bytes with a sign. "Hi" is the bytes 72 and 105, and read as a number those are 18,537. prints writes a value as text and printn writes it as a number, so the same value prints both ways. A negative value prints as text backwards.

Read the story

The specification calls Luminol functional. Functions are values, written <a, b> -> { ... }, but they cannot return anything.

The machine

CodeDoes
x : 5;Set x; as an expression it gives the value
? x { } % { }If x is true, else
& x { }While x is true
f : <a> -> { }; f(1);Make and call a function; <- returns
+ - * /Arithmetic on the values as integers
..Join the bytes of two values
-x !xFlip the sign; invert each byte
prints printnWrite text or a number
inputs("") inputn("")Read a line as text or as a number

A value is false when all its bytes are 0. The specification leaves open in which order a number's bytes run; this implementation puts the most significant first, so text and numbers read the same way.

Example

The truth machine from the specification.
Expected: Hi 18537
Expected: desserts

The truth machine from the specification. On 0 the loop never runs and the last line prints 0. On 1 it prints 1 forever.

Expected: 0

A countdown. The loop stops when n is 0, because 0 is false.

Expected: 5 4 3 2 1

Further

Functional paradigm

Write your own in Run Convert a program from Luminol

Implementation

JavaScript interpreter, source and command line

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

Command line

shib run luminol -e 'prints("Hello, World!");'
shib manual luminol

Source

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

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

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