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.

Esomath

From Esolang
Jump to navigation Jump to search
This is still a work in progress. It may be changed in the future.

Esomath

Property Value
Name Esomath (before called Mathlang but yet exists)
Designer JPEN JPEN JPEN JPEN
First appeared 2026
Paradigm Esoteric, Mathematical, Symbolic
Influenced by Mathematical notation
File extension .math
Unicode support Yes
Implementation None (planned)

Esomath is an esoteric programming language (esolang) designed to make programming resemble mathematical notation as closely as possible. Instead of adapting mathematics to programming, it adapts programming to mathematics.

The language uses Unicode mathematical symbols such as Σ, π, , , , , and ¬ as part of its syntax. It also includes symbolic programming, vectors, matrices, and built-in mathematical operations.

Philosophy

Esolang's goal is to allow programmers to write code that looks similar to equations found in textbooks.

Unlike most programming languages, mathematical symbols are treated as first-class syntax rather than aliases for ASCII operators.

Hello, world!

=> "Hello, World!"


Variables

x = 5

α = 10

β = 20


User input:


Name = ?


Operators

Category Operators
Arithmetic + − * / % ^ √ ∛ !
Comparison = ≠ < > ≤ ≥
Logical ∪ ∩ ¬

Conditionals

If statement:


{x>5,

=> "Greater than five"

}

If / Else If:


{x>5,

...

}{x>3,

...

}


If / Else If / Else:


{x>5,

...

}{x>3,

...

}{

...

}


Loops

Forever loop :

{

...

}


While loop:


{ {

...

} }


For loop:


{Σ i for 10,

...

}


Functions

f(x){

=> x²+1

}

(disclamer : it can be of any variables and can output)

Lists

L = {1,2,3}


Stack

+pile 5

-pile

pile[top]


Built-in mathematical functions

  • Prime()
  • Fib()
  • Factors()
  • GCD()
  • LCM()
  • Rand()
  • Det()
  • Inv()

Symbolic programming

Expressions may be stored symbolically instead of being evaluated immediately.


f = x²+3x+2

=> d(f)


Output:


2x+3


Unicode

MathLang supports Unicode mathematical symbols directly.

Symbol Meaning
π Pi
Infinity
Σ Summation
Π Product
Square root
Cube root
Integral
Logical OR
Logical AND
¬ Logical NOT
Membership
Not a member
Subset
Subset or equal
For all
There exists

Example

Number = Rand(1,10)

Guess = ?

{Guess = Number,

   => "Correct!"

}{Guess < Number,

   => "Too small!"

}{

   => "Too large!"

}


Implementation

No official compiler or interpreter currently exists. An implementation is planned for the future.

See also