YAASEL
Yet Another Another Stack-Based Eso-Lang. Fifteen characters, a stack of bytes and one spare byte.
Felix Eckert, 2022 · Turing complete: unknown · ●●○ moderate · esolangs.org
Tested with 3 known programs · Test method
Run it
The idea
Felix Eckert made YAASEL in 2022, partly after brainfuck. There are no number literals. A new entry on the stack starts at 0 and moves one step at a time with + and -. To go faster you put a value in the stash, push it back and add the stash to it, which doubles it. The Hello World gets from 4 to 64 in four doublings.
Read the story
There is one kind of loop. : marks a place, ! jumps back to it, and the three comparisons jump back to it when they fail. So a loop repeats its body until a comparison holds, or until $ finds the stack empty and ends the program.
The machine
| Char | Does |
|---|---|
* | Push a new entry of 0 |
+ - | Add 1 to the top, or take 1 away |
% | Print the top as a character |
# | Drop the top |
' | Move the top into the stash |
" | Push a copy of the stash |
& | Add the stash to the top |
~ | Read a line onto the stack |
: ! | Mark a jump point; jump back to it |
> < = | Go on if the top is greater, smaller or equal to the one under it, else jump back |
$ | Exit if the stack is empty |
Every other character is a comment. Values are bytes, so they wrap at 256.
Example
Hello World from the specification, without its comments.
Hello World from the specification, without its comments.
The reverse cat from the specification. ~ pushes the line in order, so the last character is on top, and the loop prints and drops until $ finds the stack empty.
A count from 0 to 9. The stash doubles 6 three times to 48, the code of 0, and keeps 57, the code of 9, under the counter. The loop prints and adds 1 until > finds the counter past 57.
Patterns it teaches
- Stack machines: one stack, with a single byte on the side.
Further
See also
Stack-based
Write your own in Run Convert a program from YAASEL
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: yaasel.
Command line
shib run yaasel -e ' ~ Get User Input
: Jump Point
% Print Top Value
# Void
$ Exit if Stack Empty
! Jump Back' --input 'Hello'shib manual yaaselSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/yaasel.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org