esolang

Flux (Esolangist)

Befunge's playfield, with loops you can name and a way back to where you were.

Esolangist, 2025 · Turing complete: unknown · ●●○ moderate · esolangs.org

Tested with 5 known programs · Test method

Run it

Expected: Hello, World!

The idea

Esolangist made Flux in 2025, after Befunge. A pointer walks a grid of characters that wraps at every edge, and each character is a command on a stack of integers with no limit on their size. An empty stack answers 0. Among what Flux adds to Befunge are two kinds of jump. l and e mark the two ends of a while loop on the grid, and m marks a place that R can jump back to later.

Read the story

The specification's table says e jumps back to its l when the top of the stack is 0. Every loop in the specification needs the opposite, a jump back while the top is not 0, and that is what this implementation does.

The machine

CharDoes
> v < ^Point the pointer
[ ] ( )Pop; on 0 turn left, right, up or down
- \|Mirrors for up and down, and for left and right
? rA random direction; a random number from 0 to 255
0 to 9Push a digit
+ S * / %Add, subtract, multiply, divide, modulo
= !Equal; not
~ : x $ { } cDrop, duplicate, copy n, swap, rotate both ways, clear
. , & 'Print a number or a character; read a number or a character
"Push the codes of the characters up to the next "
g pRead or write a cell of the grid
# £Skip the next cell, always or when the top is not 0
jJump to the cell (x, y)
m RMark a place; return to the last mark
l eSkip the loop when the top is 0; go back to l when it is not
@Halt

Example

The two Hello worlds.

The two Hello worlds. The first pushes a 0 and the text backwards, then prints until the 0 is on top. The second goes left from the corner and wraps, so it reads the text backwards on its own.

Expected: Hello, World!

The cat prints characters until it reads a null character. In this implementation the end of the input reads as 0 too.

Expected: hi

The truth machine. On 0 the £ does not skip, the pointer turns down at the first v and prints 0. On 1 it takes the second v, and R sends it back to the m and down into a loop that prints 1 forever.

Expected: 0

The XKCD random number never reaches the lines below it.

Expected: 4

Patterns it teaches

Further

Two-dimensional languages

Stack-based

Write your own in Run Convert a program from Flux (Esolangist)

Implementation

JavaScript interpreter, source and command line

A JavaScript interpreter, used in the browser and on the command line. Id: flux-esolangist.

Command line

shib run flux-esolangist -e '>'\''l:,'\''e@' --input 'Flux'
shib manual flux-esolangist

Source

Module
langs/wiki/ports.js
Interpreter
langs/wiki/flux-esolangist.js

Docs: Kernel instructions · The .shib format · Command line · Adding a language

Source esolangs.org (CC0) · Edit on esolangs.org