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
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
| Code | Does |
|---|---|
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 !x | Flip the sign; invert each byte |
prints printn | Write 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.
The truth machine from the specification. On 0 the loop never runs and the last line prints 0. On 1 it prints 1 forever.
A countdown. The loop stops when n is 0, because 0 is false.
Further
See also
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 luminolSource
- 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