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.

Normal

From Esolang
Jump to navigation Jump to search
Normal
Paradigm(s) esoteric, mathematical
Designed by User:AndrewBayly
Appeared in 2026
Type system untyped (byte cells, inherited from Brainfuck)
Memory system tape/cell-based (inherited from Brainfuck)
Dimensions one-dimensional
Computational class Unknown (conjecturally Turing complete)
Major implementations Normal (Python), (Normal JavaScript, browser)
Influenced by Brainfuck
File extension(s) .normal

Normal is an esoteric programming language in which a program does not contain any code at all. Instead, a Normal program is a pair of integers (P, L) naming the position and length of a Brainfuck program believed to already exist somewhere in the binary expansion of π. Running a Normal program means computing π out far enough to read those bits back out, decoding them as Brainfuck, and executing the result.

The language's entire premise rests on the normality conjecture: the open, unproven claim that every finite sequence of digits appears somewhere in the expansion of π, each with the expected limiting frequency. If π were shown not to be normal in base 2, some Brainfuck programs would have no valid (P, L) encoding at all, and Normal would not be Turing complete.

Encoding

A Brainfuck program is first translated into a bitstring, 3 bits per instruction:

Instruction Bits
> 000
< 001
+ 010
- 011
. 100
, 101
[ 110
] 111

For example, +[.+] (which prints the byte values 1 through 255) encodes as:

+ [ . + ]
010 110 100 010 111

giving the 15-bit string 010110100010111.

Source format

A Normal source file contains exactly two whitespace-separated positive integers and nothing else: the position P and the length L, e.g.

62564 15

Position 1 is defined as the first bit after the binary point of π, so the addressable region begins at the leftmost bit of 11.0010010000...2.

Execution

To run a Normal program (P, L), an interpreter must:

  1. Compute the binary expansion of π to at least bit P + L - 1.
  2. Extract the L bits starting at position P.
  3. Verify that L is a multiple of 3 and that the resulting instructions have balanced [ ] brackets — otherwise (P, L) is not a valid Normal program.
  4. Decode the bits as Brainfuck, 3 bits per instruction.
  5. Execute the decoded program as ordinary Brainfuck.

Because the decoded result is an unrestricted Brainfuck program, it may simply fail to halt — a source of difficulty that has nothing to do with how large P is.

Computational class

Whether Normal is Turing-complete is contingent on the normality conjecture. If π is normal in base 2, every finite bitstring — and therefore every finite Brainfuck program — occurs somewhere in its expansion, so Normal inherits Brainfuck's Turing-completeness. If π is not normal, some bitstrings may never occur, and the corresponding programs would be inexpressible in Normal. Normal's computational class is therefore not merely large or small but formally unknown: equivalent to an open problem in mathematics rather than a question about the language itself.

Existence versus verification

Even where a bitstring is conjectured to exist, most positions are far beyond anything ever actually computed. As of late 2025, the largest verified computation of π stands at 314 trillion decimal digits (roughly 1.04 quadrillion bits). For any (P, L) whose sum exceeds that, the corresponding program is, at time of writing, believed to exist but has not been observed by anyone.

Difficulty

Writing and running a Normal program get harder along the same axis — program length — rather than along axes like state count or instruction complexity:

  • Writing a program means finding a valid P for a chosen Brainfuck encoding, in the worst case requiring a search through π's digits until the target bitstring turns up.
  • Running a program means computing π out to P + L, which costs more as P grows, independent of how the position was originally found.

Heuristically treating π's bits as independent and uniformly random, the first occurrence of an L-bit string is expected near bit 2L — though this is only a heuristic, not a consequence of normality itself, which guarantees eventual appearance and correct limiting frequency but nothing about how early. In practice this gives Normal a sharp difficulty curve: a handful of instructions is typically searchable in seconds; a dozen or so already pushes into minutes-to-intractable territory on ordinary hardware.

Example

The example program above, +[.+], has been verified (via the reference implementation, below) to first occur at position P = 62564, with L = 15. Its complete Normal source is therefore:

62564 15

Running it decodes back to +[.+] and produces the 255 bytes 1 through 255 in order, over 767 Brainfuck steps.

Because π's digits, if normal, contain every finite bitstring infinitely often, this is only the earliest known encoding of +[.+] — infinitely many other valid (P, L) pairs are believed to exist for the same program at greater depths. Finding the smallest possible P for a given program is an open kind of code golf specific to Normal.

Implementation

A reference implementation exists both as a command-line tool (Python, using arbitrary-precision arithmetic via mpmath) and as a self-contained, browser-based tool (JavaScript, using native BigInt), which computes π live via Chudnovsky binary splitting and visualizes both the search for P and the resulting Brainfuck execution step by step.

The browser implementation also supports an alternative decoding strategy using the Bailey–Borwein–Plouffe (BBP) formula, which extracts hexadecimal digits of π at an arbitrary position directly, without computing any digits before it. In practice, BBP only outperforms recomputing from the first bit once P exceeds roughly 5–10 million bits, and even then by a modest margin — on the order of 20% — rather than an asymptotic one; full recomputation remains faster for the smaller positions most searches actually turn up.

Related languages

Normal is part of an informal series of esolangs exploring different notions of computational difficulty, alongside PrimeScript, Square, Trapdoor, Hard, and PrimeIndex. Where Hard is theoretically impossible and the others rely on ordinary computational complexity, Normal's difficulty is mathematical depth: the difficulty of locating a program within an infinite, largely uncomputed sequence, rather than the difficulty of a bounded computation.

See also

  • Brainfuck — the host language whose instruction set Normal decodes into.
  • Normal number — the mathematical concept the language is named for.