esolang

Nio

A stack of numbers and strings, read one character at a time, always to the right.

Zinnia Glean, 2025 · Turing complete: yes · ●●○ moderate · esolangs.org

Tested with 5 known programs · Test method

Run it

Expected: Hello, world!

The idea

Zinnia Glean made Nio in 2025 as a reboot of nori.io, a stack language that notherone created. esolangs.org credits Olus2000 with proving nori.io Turing complete. The interpreter reads the program from left to right one character at a time and ignores every character that is not a command, so most programs are a few letters and symbols.

Read the story

> pushes the value right after it, a number or a string in double quotes. Arithmetic pops two values and works in NOS × TOS order, so >7>2- leaves 5. Loops are brackets as in brainfuck, but they test the top of the stack without popping it, so a counter stays where it is.

The machine

CommandDoes
>5 >"text"Push a number or a string
< : @ $Pop, duplicate, swap the top two, reverse the stack
N I ,Read a line as a number, a line as a string, a character as its code
O o .Print and pop the top; o adds a line feed, . prints a character
XClear everything printed so far
+ - * / ^ %NOS op TOS
z c fSquare root, ceiling, floor
r b BA random number below 1, a random bit, a random byte
[ ]Skip past ] when the top is 0; go back to [ when it is not
? =5 WPop n and skip n tokens; go to character 5; go to the start
~~ ... ~~A comment

The specification also has variables, |name|value, but never shows how to read one back, so they are left out. The specification says ] jumps back when the top is 1; its own 99 bottles of beer counts down from 99, so it jumps back on every number but 0. The random commands draw from a fixed seed, so a run replays.

Example

The rectangle area asks for two numbers and multiplies them.
Expected: 5
Expected: 54321

The rectangle area asks for two numbers and multiplies them.

Expected: Width: Height: 12

The cooler adder, read by the table, prints its first number twice. After @ and : the top two are the same number, and only + brings the second one back.

Expected: 2 + 2 = 5

Patterns it teaches

Further

Stack-based

Write your own in Run Convert a program from Nio

Implementation

JavaScript interpreter, source and command line

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

Command line

shib run nio -e 'IO' --input 'cat'
shib manual nio

Source

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

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

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