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.
1 + i
- The title of this article is not correct because of technical limitations. The correct title is actually .
is an esoteric programming language by user:raiseafloppafan7741 in 2026. It is based on 14 and SELECT. with the number of focus being the complex number , since I is taken.
Commands
| Command | Description |
|---|---|
i
|
Pushes the imaginary number , the square root of -1. |
c
|
Complex conjugate of the top of the stack. |
l
|
Principal complex natural logarithm. |
e
|
. |
+
|
Addition. The second number popped is to the left of the operator. |
*
|
Multiplication. The second number popped is to the left of the operator. |
/
|
Reciprocal. |
^
|
Exponentiation. The second number popped is the base. is defined to be 1. |
>
|
Pops two real numbers b and a, and if a > b then 0 is pushed, otherwise 1. Imaginary/complex numbers halt the program.
|
<
|
Pops two real numbers b and a, and if a < b then 0 is pushed, otherwise 1. Imaginary/complex numbers halt the program.
|
[]
|
Defines a function. |
?
|
Pops a decider value x, then retrieves two functions f and g. If x is zero, then g is invoked, otherwise f is. If either operand is not a function, then the program halts only when the non-function is invoked. This means that i[]i? does not halt due to an error, but []ii? does.
|
%
|
Swap the front and the back elements of the stack. |
:
|
Duplicates the top of the stack. |
(
|
Rolls the stack left. 4 3 2 1 (LTR) becomes 3 2 1 4.
|
)
|
Rolls the stack right. 4 3 2 1 (LTR) becomes 1 4 3 2.
|
$
|
Discards the top of the stack. |
A
|
Read a byte from standard input. EOF returns . |
B
|
Read an integer from standard input. |
C
|
Read a real number from standard input. |
D
|
Read a complex number from standard input. |
p
|
Pop the top of the stack and print it as a complex number. Real numbers print as real numbers, imaginary numbers print like you'd expect ( prints as 2i for example), and complex numbers print as a + bi.
|
o
|
Pop the top of the stack and print the two bytes associated with it. The real part is printed modulo 256, and the imaginary part is outputted only if the coefficient is greater than or equal to 256. For example, outputs byte 1, while outputs 0 and 0. Non-integers are floored. |
Mismatched value type errors halt the program.
Building blocks
This section lists some "building blocks" that can be used to make programs in .
Constants
The constants are illustrated in this nice table format so you can easily compare the lengths of their "expressions". Only the shortest known "expressions" are listed here.
| Value | Expression | Length |
|---|---|---|
| Imaginary | ||
| -2i | ic:+
|
4 (shortest possible) |
| -i | ic
|
2 (shortest possible) |
| Integers | ||
| -2 | ii*:+
|
5 |
| -1 | ii*
|
3 (shortest possible) |
| 0 | iic+
|
4 (shortest possible) |
| 1 | ici*
|
4 (shortest possible) |
| 2 | ici*:+
|
6 |
| 3 | ici*::++
|
8 |
| 4 | ii+:c*
|
6 |
| 5 | ici*::+:++
|
10 |
| 6 | ici*::++:+
|
10 |
| 7 | ici*:::++:++
|
12 |
| 8 | ii+:c*:+
|
8 |
| 9 | ii+i+:c*
|
8 |
| 10 | ici*::+:++:+
|
12 |
| 11 | ici*:::+:++:++
|
14 |
| 12 | ii+:c*::++
|
10 |
| 13 | ici*:::++:+:++
|
14 |
| 14 | ici*:::++:++:+
|
14 |
| 15 | ii+:c*:*ii*+
|
12 |
| 16 | ii+:c*:*
|
8 |
| 17 | ii+:c*:*ici*+
|
13 |
| 18 | ii+i+:c*:+
|
10 |
| 19 | ii+:c*::*+ii*+
|
14 |
| 20 | ii+:c*::*+
|
10 |
| 21 | ii+:c*::*+ici*+
|
15 |
| 22 | ici*:::+:+++:+
|
14 |
| 23 | ii+:c*::++:+ii*+
|
16 |
| 24 | ii+:c*::++:+
|
12 |
| 25 | ici*::+:++:*
|
12 |
| 26 | ici*:::++:+:++:+
|
16 |
| 27 | ici*::++:^
|
10 |
| 28 | ici*:::++:++:+:+
|
16 |
| 29 | ici*::++::^+ii*+
|
16 |
| 30 | ici*::++::^+
|
12 |
Real and imaginary parts
The real part of a number can be retrieved with:
:c+ici*:+/*
And the imaginary part can be retrieved with:
ic*:c+ici*:+/*
These are from translations from SELECT. which uses the same mechanisms.
Nth roots
Square root
ici*:+/^
Cube root
ici*::++/^
Fourth root
ii+:c*/^
Fifth root
ici*::+:++/^
Sixth root
ici*::++:+/^
For a stack with the top two elements being a n, getting the nth root of a can be done as follows:
/^
Modulus
This one works by using which also produces the modulus.
:c*ici*:+/^
Examples
Print the language's name
ici*i+p
The output is 1 + i.
A+B Problem
It's not like the other A + B problem programs! It takes in two complex numbers and adds them.
DD+p
Truth-machine
Only accepts 1.
[$$[(:p)i?]i?][$$p]C:)ii*+?
Cat program
[][(oA:)ic+?]A:)ic+?