Slim

From Esolang
Jump to: navigation, search

Slim is a minimalistic stack-based esoteric programming language designed by User:Scoppini in 2015.

Overview

Slim operates on a stack of Boolean values, which starts out completely empty. The commands are:

Command Description
0 Push a zero onto the stack.
@ Flip the top bit of the stack, and send it to the bottom.
< Move the bottom bit of the stack to the top.
X Pop the stack.
^ Output the top bit to the output stream (bits are output in big-endian order).
| Push a bit of input onto the stack (also in big endian order).
: If the top bit is 0 or the stack is empty, do nothing. Otherwise, pop the stack as long as the top bit is 1 and the stack isn't empty. After the stack has finished being popped, jump to nth : in the code, where n is the number of times the stack was popped.

Examples

Hello, World! program

0^@^@^^@^@^^^
^@^^@^^@^@^@^
@^@^^@^@^^@^^
^@^^@^@^^@^^
^@^^@^@^^^^
@^^@^@^^^^^
^@^@^@^@^@^^^
@^@^^@^@^^^^
@^@^^^@^^@^@^
^@^^@^@^^@^^
^@^^@^^@^@^^
^^@^@^^^^@^
@^^^^@^@^@^@^

Cat program

0@0@0@0@0@0@0@0@0@
:0@^|^X|^X|^X|^X|^X|^X|^X0@0@0@0@0@0@0@0@
:0^@^|^X|^X|^X|^X|^X|^X0@0@0@0@0@0@0@0@
:0^^@^|^X|^X|^X|^X|^X0@0@0@0@0@0@0@0@
:0^^^@^|^X|^X|^X|^X0@0@0@0@0@0@0@0@
:0^^^^@^|^X|^X|^X0@0@0@0@0@0@0@0@
:0^^^^^@^|^X|^X0@0@0@0@0@0@0@0@
:0^^^^^^@^|^X0@0@0@0@0@0@0@0@
:0^^^^^^^@^0@0@0@0@0@0@0@0@
:|:@|:@|:@|:@|:@|:@|:@|:

Truth-machine

0@0@0@0@0@0@0@0@0@|
:X|
:X|@<
:X|@<
:X|
:X|
:X|
:XX|
:^^@^^@<^^^^@0@
:0^^@^^@^^^@^0@0@0@0@0@0@0@0@
:

External resources