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
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
| Statement | Does |
|---|---|
let x = e | Store e in x |
let x[i]= e | Store e in item i of list x, only with ]= written together |
if e then ... else ... end | Run one block; without an else, a false test skips to the end |
while e do ... end | Repeat while e is not 0, an empty string or an empty list |
function / name / ... / end | Define a function, the name on its own line |
call f call append(l, e) | Run a function; append to a list |
return e | Leave the current block |
print e printch e | Print a value; print one character or a code |
read x readch x | Read 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.
Written for the interpreter, the same sum works. The index comes first and + splits it off.
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.
See also
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-languageSource
- 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