esolang

Minimialized Programming Language

A grammar in the specification, and a Python interpreter under it that reads something else.

PSTF, 2025 · Turing complete: unknown · ●●○ moderate · esolangs.org

Tested with 3 known programs · Test method

Run it

Expected: Hello, World!

The idea

PSTF wrote this small language in 2025. It has let, if, while, functions, lists and four kinds of I/O, and it gives a tidy grammar for them. The specification also gives the interpreter, about 250 lines of Python, and this implementation runs programs the way that interpreter does.

Read the story

The interpreter does not parse. It looks at the text of an expression and tries one check after another. Is it a string, a character, a list, an index, a call of length, chr or ord, a number, a variable? If not, it splits the text at the first ==, !=, <, +, -, * or / it finds and works out both sides. Blocks run to the first else or end line, so they cannot nest.

The machine

StatementDoes
let x = eStore e in x
let x[i]= eStore e in item i of list x, only with ]= written together
if e then ... else ... endRun one block; without an else, a false test skips to the end
while e do ... endRepeat while e is not 0, an empty string or an empty list
function / name / ... / endDefine a function, the name on its own line
call f call append(l, e)Run a function; append to a list
return eLeave the current block
print e printch ePrint a value; print one character or a code
read x readch xRead a line as an integer, or its first character

Values are integers of any size, strings and lists, and a string literal is a list of characters. Variables are all global.

Example

The Hello World never ends, because nothing moves i on.

The Hello World never ends, because nothing moves i on. With the missing line it prints.

The list sum from the interpreter's own tests prints Sum: 0. The expression sum + numbers[i] ends with ], so it is taken as an index, into a list named sum + numbers. There is none, so it is 0.

Expected: Sum: 0

Written for the interpreter, the same sum works. The index comes first and + splits it off.

Expected: 15

The other test, a string reversal, prints nothing, because >= is not an operator the interpreter knows and the loop never starts. The Fibonacci program prints 0 for any input. Its function begins with the line function fib, and only a line that is exactly function starts a function.

Further

Also in Turing tarpits

Write your own in Run Convert a program from Minimialized Programming Language

Implementation

JavaScript interpreter, source and command line

A JavaScript interpreter, used in the browser and on the command line. Id: minimialized-programming-language.

Command line

shib run minimialized-programming-language -e '
    let numbers = [1, 2, 3, 4, 5]
    let sum = 0
    let i = 0

    while i < length(numbers) do
      let sum = sum + numbers[i]
      let i = i + 1
    end

    print "Sum: "
    print sum
    '
shib manual minimialized-programming-language

Source

Module
langs/wiki/ports.js
Interpreter
langs/wiki/minimialized-programming-language.js

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

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