We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

Simpl

From Esolang
Jump to navigation Jump to search

Simpl is an esoteric programming language created by User:Cordership in 2026, designed to be simpler than Python.

Syntax

Operation/command Meaning
+ Adds two numbers
- Subtracts two numbers
* Multiplies two numbers
/ Divides two numbers
^ Exponentiation
= Equals
> Greater than
< Less than
! Factorial (if right after a variable) or exclamation mark (in printed text)
sqrt() Sqrt of a number
mod(a, b) The remainder of integer division a/b.
sin() Sine of a number
cos() Cosine of a number
tan() Tan of a number
asin() Arcsin of a number
acos() Arccos of a number
atan() Arctan of a number
hyp(a, n, b) Succession if n = 0, a + b if n = 1, a * b if n = 2, a ^ b if n = 3, a tetrated to b if n = 4, so on...
log(a, b) Outputs a number n where a ^ n = b
print("") Prints text
print() Prints a number or a variable with float/integer value
def f(x)=[blah blah blah] Sets f(x) to [blah blah blah]
assign var a = [blah blah blah] Sets variable a to [blah blah blah]
print (A) n times Prints a chain of n As. The "A" can be altered to be any text.
print (n)(cars) Prints the given text, but if n is a variable, replace n with its value. The "cars" text can be changed into any text. Note that the resulting printed text has a space if one input has a space in it, whereas two spaces (either the first input has 1 space at the end, the second input has 1 space at the beginning or one of the inputs have 2 consecutive spaces) cause the output to have 2 consecutive spaces.
[new line] Makes a new line in a “print” command.
end program Ends the program.
ask (Input?) Asks "Input?". The question can be changed at will.
assign var a = ans Sets variable a to the answer of an "ask" command.
check if [desired condition] yes: no: If desired condition is met, the code continues in the yes section. Otherwise continue code in the no section.
check if [desired condition]: If the desired condition is met, continue the code in this command. Otherwise, skip it.
add n to list ([list name]) Adds variable n as an element to the end of list [list name].
print list ([list name]) Prints list [list name].
repeat n Repeats n times.
repeat until [desired condition] Repeats until desired condition is met.
list add ([list name]) Sum of all the elements in list [list name], if all of them are numbers.
list multiply ([list name]) Product of all the elements in list [list name], if all of them are numbers.
assign numbase (n) Sets the number system to base n.
list union ([2, 3, 4], [1, 3, 5]) Treats the lists as sets and unifies them, numbers in both of the original lists only appear once in the new list. In this case, the output is [1, 2, 3, 4, 5].
list intersect ([1, 2, 4], [2, 4, 5]) Treats the lists as sets and outputs their intersection. In this case, the output is [2, 4].
list xor ([3, 4, 5, 7], [2, 3, 4]) Treats the lists as sets and outputs the XOR of both of them. In this case, the output is [2, 5, 7].
element (n) of ([listname]) Nth element of list [listname].
add (a) to list ([listname]) (n) times Adds n elements to the end of the list, where all of them are of the variable "a". The variable can be changed to be any variable.
rand integer (a) to (b) Picks random integer in range from a to b.
rand integer between (a) (b) Picks random integer between a and b
change pointer (n) Moves pointer left or right by n cells (if n < 0, then left, if n > 0, then right, if n = 0, then it stays still)
assign var memcell pointer = n Assigns the ASCII number of the character in the memorycell at the pointer to n.
assign var memcell pointer = memcell pointer + n Checks the value of the ASCII character in the memorycell of the pointer then adds n to it.
carry memcell pointer to s(b) Carries the ASCII character in the memory cell at the pointer to replace the ASCII character in the memory cell of s(b), dragging the pointer along.
print (memcell pointer) Prints the ASCII character in the memory cell at the pointer.
[smooth] Connects two printed texts "smoothly", that is, without gaps.
f(x, y) Function with two inputs. Functions can be made with any number of inputs.
while 1: Repeat forever.
while 0: Avoids loop completely.
memcell pointer Variable, is the value of the ASCII character in the memory cell at the pointer.
while [desired condition] Loops while condition is true.
=/= Not equal to
change (n) to int Changes the value of a float variable n to an integer variiable.
log(a, b) Logarithmic function.
const.e The constant e, rounded to 100 decimal digits.
const.pi The constant pi, rounded to 100 decimal digits.
round (x) to (n) Rounds x to the nearest multiple of n. If x = k * n + n / 2, then output is n * (k + 1), where k is either an integer float or an integer.

Note: If a variable is added into a list, the list receives the value of that variable.

Note 2: Between two print commands is a new line character.

Note 3: The ASCII character in a memory cell equals its corresponding value.

Note 4: ("") is string, () is float or integer.

Examples

Hello, world!

print ("Hello, World!")

Fibonacci sequence

assign var a = 0
ask (How many Fibonacci numbers, starting from 0?)
assign var n = ans
def fib(x) = fib(x - 1) + fib(x - 2)
def fib(0) = 0
def fib(1) = 1
repeat n:
-> add fib(a) to list (FibonacciNumbers)
-> assign var a = a + 1
print list (FibonacciNumbers)

Collatz sequence

ask (Input?)
assign var a = ans
def col (x) = 3x + 1 {mod(x, 2) = 1}, x/2 {mod(x, 2) = 0}
repeat until a = 1:
-> assign var a = col(a)
-> print (a)
-> add to list (CollatzSequence)
print list (CollatzSequence)

Truth-machine

ask (Input?)
assign var a = ans
check if a = 0:
yes:
-> print (0)
no:
check if a = 1
-> repeat inf:
-> -> print (1)

Check even/odd

ask (Input?)
assign var a = ans
check if mod(a, 2) = 0:
yes:
-> print (a)(" is even")
no:
-> print (a)(" is odd")

Looping counter

assign var a = 1
def f(x) = x + 1
while 1:
-> print (*) a times
-> assign var a = f(a)

99 bottles of beer on the wall

assign var n = 99
def f(x) = x - 1
repeat until n = 2:
-> print (n)(" bottles of beer on the wall, 
[new line]")(n)(" bottles of beer.
[new line] Take one down, pass it around,
[new line]")(f(n))(" bottles of beer on the wall.
[new line]
[new line]")
-> assign var n = f(n)
print ("2 bottles of beer on the wall,
[new line] 2 bottles of beer.
[new line] Take one down, pass it around,
[new line] 1 bottle of beer on the wall.
[new line]
[new line]")
print ("1 bottle of beer on the wall,
[new line] 1 bottle of beer.
[new line] Take one down, pass it around,
[new line] No bottles of beer on the wall.
[new line]
[new line]")
print ("No bottles of beer on the wall,
[new line] No bottles of beer.
[new line] Go to the store, buy some more,
[new line] 99 bottles of beer on the wall.")

Factorials

ask (Input?)
assign var n = ans
def f(x) = x!
assign var t = f(n)
print (t)

Disan count

ask (Upper bound?)
assign var n = ans
assign var x = 1
repeat until x = n:
-> check if 0 < x < n
-> -> check if mod(x, 2) = 0:
-> -> yes:
-> -> -> add to list (EvenNumbersFinite)
-> -> -> assign var x = x + 1
-> -> no:
-> -> -> assign var x = x + 1
print list (EvenNumbersFinite)

Conway’s Game Of Life LWSS

print (o . . . o .
[new line] . . . . o
[new line] o . . . o
[new line] . o o o o)

Or this:

print (x = 5, y = 4, rule = B3/S23
[newline]o3bob$4bo$o3bo$b4o!)

FizzBuzz

assign var n = 1
repeat until n = 100:
-> check if mod(n, 3) = 0:
-> yes:
-> -> check if mod(n, 5) = 0:
-> -> yes:
-> -> -> add ("FizzBuzz") to list (NaturalNumbersFizzBuzz)
-> -> no:
-> -> -> add ("Fizz") to list (NaturalNumbersFizzBuzz)
-> no:
-> -> check if mod(n, 5) = 0:
-> -> yes:
-> -> -> add ("Buzz") to list (NaturalNumbersFizzBuzz)
-> -> no:
-> -> -> add (n) to list (NaturalNumbersFizzBuzz)
-> assign var n = n + 1
print list (NaturalNumbersFizzBuzz)

W110 from three inputs p, q, r

ask (Input number 1?)
assign var p = ans
ask (Input number 2?)
assign var q = ans
ask (Input number 3?)
assign var r = ans
check if p = 0:
-> check if q = 0:
-> -> check if r = 0:
-> -> -> print (0)
-> -> check if r = 1:
-> -> -> print (1)
-> check if q = 1:
-> -> check if r = 0:
-> -> -> print (1)
-> -> check if r = 1:
-> -> -> print (1)
check if p = 1:
-> check if q = 0:
-> -> check if r = 0:
-> -> -> print (0)
-> -> check if r = 1:
-> -> -> print (1)
-> check if q = 1:
-> -> check if r = 0:
-> -> -> print (1)
-> -> check if r = 1:
-> -> -> print (0)

Cat program

ask (Input?)
assign var n = ans
print (n)

A+B Problem

ask (First number?)
assign var a = ans
ask (Second number?)
assign var b = ans
assign var sum = a + b
print (sum)

Primes using Erastothenes sieve

assign var n = 0
add 2 to list (Primes)
add 3 to list (Primes)
add 5 to list (Primes)
add 7 to list (Primes)
repeat 100:
-> assign var n = n + 1
-> check if mod(n, 2) =/= 0:
-> -> check if mod(n, 3) = 0:
-> -> -> check if mod(n, 5) = 0:
-> -> -> -> check if mod(n, 7) = 0:
-> -> -> -> -> add n to list (Primes)
print list (Primes)

Digital root calculator

ask (Input number?)
assign var n = ans
def digitroot(x) = 1 + mod(n - 1, 9)
print (digitroot(x))

XKCD Random Number

assign var randomize = 4
print(randomize)

Infinite loop

while 1:

Pi

ask (How many terms?)
assign var n = ans
assign var p = 0
change (p) to int
def f(x) = ((4 * x)! * (1103 + 26390 * x)) / ((x!) ^ 4 * 396 ^ (4 * x))
repeat n:
-> assign var t = f(p)
-> change (t) to int
-> add t to list (PiSum)
-> assign var p = p + 1
assign var a1 = list add (PiSum)
assign var a2 = a1 * (2 * sqrt(2)) / 9801
assign var a3 = 1 / a2
print (a3)

"Welcome" text in the istplng talk page archive before july 10th 2025

print (___         ___    _________    ___          ________     _______       ______ _____      _________
[new line]   /  /| ___   /  /|  /  ______/|  /  /|       ,' ______/|  ,' ____  \    ,' ___  '___  \    /  ______/|
[new line]  /  / //  /| /  / / /  /|_____|/ /  / /      /  /|_____|/ /  /|__/  /|  /  /|_/  /|_/  /|  /  /|_____|/
[new line] /  / //  / //  / / /  ______/|  /  / /      /  / /       /  / / /  / / /  / //  / //  / / /  ______/|
[new line]/  /_//  /_//  / / /  /|_____|/ /  /_/___   /  /_/____   /  /_/_/  / / /  / //__/ //  / / /  /|_____|/
[new line]\______,_____,' / /________/|  /________/|  \________/|  \_______,' / /__/ / |__|//__/ / /________/|
[new line]\______,______,'  |________|/  |________|/  \________|/  \________,'  |__|/       |__|/  |________|/)

Euler-Mascheroni constant to desired precision

ask (Precision of e?)
assign var t1 = ans
change (t1) to int
assign var n = 0
repeat t1:
-> assign var t2 = 1 / n!
-> add t2 to list (sumofe)
-> assign value n = n + 1
assign var t3 = log(list add (sumofe), t1)
assign var t4 = 1
ask (How many terms?)
assign var p = ans
repeat p:
-> assign var t5 = 1 / t4
-> add t5 to list (harmonicnum)
-> assign var t4 = t4 + 1
assign var t6 = list add (harmonicnum) - t3

Malbolge tritwise crazy operation

ask(Input value 1?)
assign var a = ans
ask(Input value 2?)
assign var b = ans
def crazy(x1, x2) = 0
def crazy(0, 0) = 1
def crazy(1, 0) = 0
def crazy(2, 0) = 0
def crazy(0, 1) = 1
def crazy(1, 1) = 0
def crazy(2, 1) = 2
def crazy(0, 2) = 2
def crazy(1, 2) = 2
def crazy(2, 2) = 1
print (crazy(a, b))

Tommyaweosme constant

assign var a = 0
repeat inf:
-> print (56) a times
-> [smooth]
-> print (5687)
-> assign var a = a + 1

Tommyaweosme function

ask (Input?)
assign var a = ans
assign var b = 2 * (a + 5)
repeat until b < 10:
-> assign var b = b - 10
check if b = 0:
yes:
-> print (87)
no:
-> repeat inf:
-> -> print (56)

4-function calculator

ask (Input 1?)
assign var a1 = ans
ask (Input 2?)
assign var a2 = ans
ask (Function-type value?)
assign var a3 = ans
check if a3 = 1:
-> def f(x, y) = x + y
-> print (round (f(a1, a2)) to (0.001))
check if a3 = 2:
-> def f(x, y) = x - y
-> print (round (f(a1, a2)) to (0.001))
check if a3 = 3:
-> def f(x, y) = x * y
-> print (round (f(a1, a2)) to (0.001))
check if a3 = 4:
-> def f(x, y) = x / y
-> print (round (f(a1, a2)) to (0.001))

Ackermann function

ask (Input 1?)
assign var a = ans
ask (Input 2?)
assign var b = ans
def f(x1, x2) = hyp(2, x1 - 2, x2 + 3) - 2
def f(0, n) = n + 1
assign var t = f(a, b)
print (t)

Sgn Machine

ask (Input?)
assign var a = ans
check if a > 0:
yes:
-> print(1)
no:
-> check if a = 0:
-> yes:
-> -> repeat inf:
-> -> -> print (0)
-> no:
-> -> print(-1)

Turing-completeness

This esolang is turing-complete by reduction to brainfuck. Proof:

  • change pointer 1 corresponds to >.
  • change pointer -1 corresponds to <.
  • assign var memcell pointer = memcell pointer + 1 corresponds to +.
  • assign var memcell pointer = memcell pointer - 1 corresponds to -.
  • print (memcell pointer) corresponds to ..
  • assign var memcell pointer = n corresponds to ,.
  • while memcell pointer =/= 0: corresponds to a [] loop.

Categories