esolang

Inputer

A stack language with no way to write a number. Every number has to be typed in.

ChuckEsoteric08 · Turing complete: yes · ●○○ easy · esolangs.org

Tested with 5 known programs · Test method

Run it

Expected: 5

The idea

ChuckEsoteric08 made Inputer after Volatile, another stack language. The one way to put a number on the stack is to read it from the user. There are no literals at all, so a program can only work with what it reads and with what it adds, multiplies and divides out of that. The specification calls it Turing complete by a translation from VolatiIO, a Volatile that reads its numbers, but its table leaves one VolatiIO command without an Inputer form.

The machine

CommandDoes
'Read a number and push it
+ - * /Pop a, then b, and push b+a, b-a, b*a, b/a
( ... )Loop while the top is not 0
! ... ?? pops, and goes back to its ! if that differs from the new top
#Print the stack

The only output is #, which the specification calls a debug command. It prints the stack bottom first, the numbers split by spaces, with a line feed after.

Example

The number guessing game reads the number to guess, then reads guesses until one matches.

The number guessing game reads the number to guess, then reads guesses until one matches. Each guess shows the pair on the stack.

Expected: 7 3 7 7

The repeating cat stops on a 0. Nothing is ever popped, so each print shows every number read so far.

Expected: 3 3 4 3 4 0

Patterns it teaches

Further

Also in Functional and concatenative

Write your own in Run Convert a program from Inputer

Implementation

JavaScript interpreter, source and command line

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

Command line

shib run inputer -e ''\''#' --input '5'
shib manual inputer

Source

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

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

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