Sansism

From Esolang
Jump to navigation Jump to search

Sansism is an esoteric programming language devised by Safalra (Stephen Morley) in November 2003. It is based on Brainfuck and Befunge. Originally a two-dimensional language, it was later generalised to function in any number of dimensions while still using the same eight instructions. Sansism is Turing Complete.

Origin of the name

If you like recursive acronyms, Sansism stands for Safalra Allowed No Swearing In Sansism's Moniker (as opposed to Urban Müller, who did allow swearing in Brainfuck's name). If you don't like recursive acronyms, Sansism is a compound word meaning 'without doctrine' (sans ism).

Two-dimensional Sansism

The memory

Sansism's memory is two dimensional. A memory pointer is moved through the memory using the ! command. The direction of movement is controlled by the memory director which is rotated anticlockwise using the # command.

The codespace

Sansism's codespace is also two dimensional. The program counter moves through the codespace after each command is executed in a direction specified by the program director, which is rotated counter-clockwise by the G command if the current memory cell is non-zero. The > command sets the program director to point right.

Other commands

The . , + and - commands behave exactly as they do in Brainfuck.

Multidimensional Sansism

Sansism can be extended to multiple dimensions by generalising the rules for the memory director and program director. The precise details can be found in the Multidimensional Sansism specification, under External resources.

Computational class

Sansism is Turing Complete, by equivalence to Brainfuck.

Example programs

The examples programs can be used with the Sansism Interpreter, found under External resources.

Hello World

           G                                  GGG
>++++++++++>!+++++++!++++++++++!+++!+##!!!!##-G+G
G.+++++++++++++++##!!##.++!.+++..+++++++.+!.++! G
G!.+++.------.--------.!+.!.G                  GG

External resources