esolang

Fission

Atoms fly over the grid, splitting and fusing, and the program ends when the last one is gone.

C0deH4cker, 2014 · Turing complete: unknown · ●●○ moderate · esolangs.org

Tested with 4 known programs · Hello World on Try It Online: identical · Test method

Run it

Expected: Hello, World!

The idea

C0deH4cker made Fission in 2014. The program is a grid, and the threads are atoms. Each atom has a mass, an energy and a direction, and all of them move one cell per tick at the same time. Reactors split an atom in two, fusers join two into one, and when no atom is left the program ends.

Read the story

Data lives in the atoms themselves. A letter sets an atom's mass to its character code, ! prints the mass, + and _ change it, and the energy decides the conditional mirrors.

The machine

CharDoes
U D L RStart an atom moving up, down, left or right
/ \ M W [ ]Mirrors, and arrows that set a direction
^ V < >Reactors: split an atom at the point, turn it from the side, store from the back
A Y { }Fusers: join two atoms from the sides, clone one at the point
? ! O NRead a byte into the mass, print it, print and destroy, print a newline
+ _ $ ~ @Mass up and down, energy up and down, swap them
% &Mirrors that spend one energy, or act the other way round with none
K QA stack and a queue of atoms
Z S X : # \| -Turns, cloning, halving, random turns, reflections
" 'Print up to the next "; take the next character as mass
a-z 0-9 JSet the mass, teleport, jump
; *Destroy the atom; end the program

Example

The simplest Hello World, with one atom printing everything between the quotes.

The simplest Hello World, with one atom printing everything between the quotes.

Reverse the input, from the specification. The atom from L reads a byte at ?, the fuser A clones it, one copy goes into the stack K and the other goes round to read the next byte. At the end of input the atom's energy lets it slip through Z, ~ makes it negative, and K hands back the bytes in reverse order to be printed at !.

Expected: cba

Patterns it teaches

Further

Two-dimensional languages

Write your own in Run Convert a program from Fission

Implementation

JavaScript interpreter, source and command line

A JavaScript interpreter, used in the browser and on the command line. Id: fission.

Command line

shib run fission -e 'R"Hello, World!";'
shib manual fission

Source

Module
langs/tio/ports.js
Interpreter
langs/tio/fission.js

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

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